Commit Graph

29 Commits

Author SHA1 Message Date
Bryan Housel
b0cba113e9 Fix directional vertices on IE11/Edge
(closes #4710)
2018-01-19 20:32:45 +00:00
Bryan Housel
ea9643e08b Allow Alt/option key to disable geometry check and nope cursor
(re: #4646)
2018-01-08 15:47:29 -05:00
Bryan Housel
6881205d43 All touch targets are GeoJSON now
This makes the code a bit more consistent and lets us avoid some
hacky and probably non-performant things:
- abusing CSS classes in the draw/drag datum functions (classed `.target`)
  (is this thing target? just check d.properties)
- regexing the id for `-nope$`
  (is this thing a nope target? just check d.properties)
- using context.hasEntity to get a the real entity
  (is this thing a real osmEntity? just check d.properties)
- fixes code like the restriction editor which uses fake ids for split ways
2018-01-01 22:37:10 -05:00
Bryan Housel
fa7a6ebb12 Snap to nope line targets too, also remove svgBlocker, not needed
(it's easier to just class the surface, and won't interfere with snapping)
2017-12-27 22:51:36 -05:00
Bryan Housel
009d7b0d65 Add layer blocker and polygon self-intersection geometry check 2017-12-24 09:21:59 -05:00
Bryan Housel
5d9b051f84 Fix drag_node for touch targets and line snapping 2017-12-21 20:31:20 -05:00
Bryan Housel
f58349864c Add support for nope targets, line sub-segment targeting 2017-12-20 13:52:16 -05:00
Bryan Housel
7a8f50c74e More fixes for drawing/snapping, don't draw touch targets for activeIDs 2017-12-18 22:54:49 -05:00
Bryan Housel
aa68b21d7a Add touch targets for line/area 2017-12-17 22:53:58 -05:00
Bryan Housel
5e99f3cbac CSS pointer-events cleanup, also round linejoins 2017-12-16 11:32:26 -05:00
Bryan Housel
5a4faa84a1 Fixed some of the point/vertex/midpoint snapping issues
Still working on snapping to lines/areas, and making sure drawing lines/areas
will complete
2017-12-16 01:33:12 -05:00
Bryan Housel
5cb5456869 Implement touch targets for midpoints and points 2017-12-15 22:50:55 -05:00
Bryan Housel
89d8d37576 Drawing all the correct vertices now where I want them, simplify classes
Some highlights
- `getSiblingAndChildVertices` are expensive, so they're saved and called less frequently
- draw touch targets for all the visible vertices
- remove redundant css classes and `setClass` function
2017-12-15 17:28:20 -05:00
Bryan Housel
ba5b3eee9c More work on vertex drawing, add debug for touch targets 2017-12-15 00:26:37 -05:00
Bryan Housel
b9e48d1682 WIP: Move layer-hit to layer-points with explict sublayers, update tests
This is more work to further isolate the layers that entities draw to.
It makes it easier to debug what is going on, and can eventually lead to
deferred drawing, if each draw function is in its own place and not dependant
on anything else.

I've started to replace the vertex-hover with an explicit layer for touch
targets.

Also had to change a lot of the svg tests, which are really brittle.
Things would happen like - the surface would be created, it would kick of a
deferred redraw, which would notice that the zoom was 0 and call
editOff, which would remove the osm layers that were just created and
that the tests were trying to draw to. These tests need proper zoom and
projection otherwise nothing works.
2017-12-14 17:38:43 -05:00
Bryan Housel
bfaf17538e Move text to single group with subgroups for halo,label,debug 2017-12-14 12:32:28 -05:00
Bryan Housel
d9e3367836 More improvements to label vertex avoidance
(re: #4271, #3636)

- better classification of "interesting" vertices
  (include tagged, selected, or child of selected)
- now we can draw labels on selected lines again (revert #3636)
  because the labels will avoid the vertices
- if debugging is on, draw a collision box for the mouse
2017-12-13 18:05:06 -05:00
Bryan Housel
899abc7ef5 WIP to render vertices while dragging
(re: #3003 / #4602)

For now, drawHover is commented out.  Still not sure what I will do with it.
This means that things flicker a bit when dragging, also connecting nodes
(and closing lines) does not currently work.

There was lot going on preventing the vertices from rendering while dragging.

1. `modeDragNode` needed a proper `selectedIDs()` function that works like other
modes.. Many other places in iD (including the vertex renderer) call `context.selectedIDs()`..
This means that `modeDragNode` needs a new function `restoreSelectedIDs()` to do what
`selectedIDs()` was previously doing (a place to store selectedIDs so that we
can reselect those entities after the user is done dragging a node in select mode)

2. Just so many things in svg/vertices.js
  - siblingAndChildVertices was missing some things for points that we render
    as vertices (points in wireframe, points with directions)
  - the sibling vertices weren't being included in the `filter` function, so
    would disappear when doing differenced/extent redraws
  - probably some other things
2017-12-12 17:39:36 -05:00
Bryan Housel
6aba27c84a Display directional vertex with a viewfield, not an arrow 2017-12-08 14:29:56 -05:00
Bryan Housel
b79b6ca97a Support rendering direction on vertices (stop sign, traffic_signals, etc)
(closes #3815)
2017-12-07 22:48:03 -05:00
Bryan Housel
af31cf5eb5 Fix spacedraw drawing, make clicking less touchy
(closes #3986)

Root cause was the vertex shadow strokes were too big, esp on endpoints.
For normal lines 16px stroke width centers on the line, but for vertices
it extends beyond the vertex radius, stealing clicks.

Also switched some "globals" to module variables in draw.js
2017-04-26 16:37:15 -04:00
Bryan Housel
3d762b58f6 Add an ellipse to resolve point ambiguity when dragging
(closes #3536)
2017-04-26 02:08:54 -04:00
Bryan Housel
6de6056c66 Don't hover sidebar or vertices when alt key disables snapping
This makes it a little more clear that the alt key is doing its job
2017-04-23 11:11:16 -04:00
Bryan Housel
7548b62918 Fix many more rtl styles for raw tag editor, etc 2017-03-22 01:26:12 -04:00
Bryan Housel
af757d31be General usability improvements
* Reevaluate all featuers stroke widths for shadow, casing, stroke
* Shadow width is important to make sure all features are easily clickable
* Casing width is important to see oneway arrows
* Make sure all line styles have normal and low-zoom variants
* Show directional arrows for all waterway types
2017-03-16 16:16:35 -04:00
Bryan Housel
52d37d999b Style vertices in the preset list with circular frame
(closes #3569)
2017-03-08 16:46:30 -05:00
Bryan Housel
9ce06549e1 Add new poi icons, make them work on point, vertex, area label
(closes #3856)
2017-02-26 23:28:29 -05:00
Bryan Housel
4826dfb8e1 Move fills to their own css file and class as important 2017-02-20 16:54:37 -05:00
Bryan Housel
5c8bb43ec0 Combine all the css files into dist/iD.css 2017-02-20 15:55:27 -05:00