Commit Graph

32 Commits

Author SHA1 Message Date
J Guthrie d35494d003 Can finish drawing when cursor is in invalid position
- When drawing an Area, the leading edge is allowed to temporarily be in an invalid position (see #4655)..
    .. Finishing a drawing is disabled if doing so would close with the invalid leading edge
2018-03-08 02:53:03 +00:00
Bryan Housel f0a27bc1ec Simplify way segmentation and fix bug with adjacent segment type
(closes #4669)

Now instead of creating MultiLineString targets, we just create a bunch of
LineString targets.  This makes the code simpler, and anyway the entity is
still there in `properties` for drawing code to decide what to do with the target.

Incidentally, this change allows iD to support an extrusion operation.
(Because each way segment has its own unique GeoJSON target now)
2018-01-09 10:12:29 -05:00
Bryan Housel e661281e38 Prevent self intersecting lines without a junction node
(closes #4646)
2018-01-08 19:17:50 -05: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 58eaca2aa0 Ignore area closing segment during move when validating geometry
(closes #4655)
2018-01-08 12:09:17 -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 4f02340374 Extract self-intersection code to geoHasSelfIntersections
Test for self-intersecting areas in both drag_node and draw_way
2017-12-28 23:10:52 -05:00
Bryan Housel ee617779a4 Snap to nope targets too (snapping is useful feedback)
Also remove "acting" cursor, which was overriding the no-action
cursor in some situations.
2017-12-25 23:11:00 -05:00
Bryan Housel 64a11f4cbf Restore ability to extend line at beginning or end 2017-12-22 15:08:05 -05:00
Bryan Housel 2be62fffe5 All the complicated code in drawWay can be removed
Now that we can target specific segments along a line, we don't need
temporary drawing objects or extra code to check for self intersections
2017-12-22 00:01:23 -05:00
Bryan Housel 5d9b051f84 Fix drag_node for touch targets and line snapping 2017-12-21 20:31:20 -05:00
Bryan Housel 7994baae23 WIP: trying singular activeID and smarter target drawing code
The goal here is that the code that draws the targets should know better
what parts of the lines/vertices are targetable, rather than just
relying on CSS to ignore the pointer events on the whole line.

e.g. when drawing a line, it's ok for it to loop back and connect
to itself, just not on a segment or vertex adjacent to the active
node.
2017-12-19 11:23:35 -05:00
Bryan Housel 563c496a65 Update selected vertices when drawing in select mode
This is a better solution to catching and drawing new verteices that
got added because a user double clicked on a line.
2017-12-19 09:08:59 -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 75d2c45fd6 Convert lodah-es and d3 to named imports for behaviors 2017-09-24 21:43:54 -04:00
Bryan Housel 4ee5d7334b Fix spacebar drawing and hover in Firefox - don't match active node
(closes #4016)
2017-05-08 01:37:38 -04:00
Bryan Housel a18d690dd5 Don't let window.location changes happen during draw modes
(closes #3996)
2017-05-03 17:15:35 -04:00
Bryan Housel 651ec363f6 Undo/Redo while drawing line/area should keep the user in drawing mode
(closes #3530)
2017-05-03 16:08:23 -04:00
Bryan Housel e756520bd8 suppressMenu(true) is now the default 2017-02-21 15:47:22 -05:00
Bryan Housel fd9b3931d8 Use temp names for temp segments
(closes #1369)
2017-01-13 18:44:42 +05:30
Bryan Housel 45b7a40557 Fix area drawing for #3676
These changes are needed now that `addNode`
* wants to preserve circularity
* automatically remove duplicates
* range checks index argument (can't call it with -1 anymore)
2017-01-12 19:30:07 +05:30
Bryan Housel 07fa5fcc34 Refactor Entity, Node, Relation, Tags, Way from core to osm 2016-10-11 22:41:24 -04:00
Bryan Housel 3102a4ae6a Rename all the things to include pseudonamespaces 2016-10-04 19:06:20 -04:00
Tom MacWright 947a1d9c1a Resolve lints 2016-09-03 19:08:03 -04:00
Tom MacWright 3af54610ca Refactor customEvent system to use d3.customEvent 2016-09-03 17:56:56 -04:00
Bryan Housel a86f34b4ef Pacify eslint, get build and tests running again 2016-08-26 01:15:07 -04:00
Tom MacWright cdb533fa84 Begin d3 v4 update 2016-08-21 15:19:27 -04:00
Tom MacWright af776501d3 Require locale, second pass (#3259)
* Require locale, second pass

* Remove t global, remove t where it isn't needed
2016-07-21 16:20:13 -04:00
Tom MacWright 604d1e2719 import lodash (#3257) 2016-07-19 12:04:16 -04:00
Kushan Joshi 39c82af158 Sort modules [eslint rule] 2016-07-06 12:12:08 +05:30
Kushan Joshi 0939983515 external modules for behavior 2016-06-22 12:34:43 +05:30
Kushan Joshi 14f0d95e94 modularize iD.behavior 2016-06-17 12:53:19 +05:30