Snap to nope targets too (snapping is useful feedback)

Also remove "acting" cursor, which was overriding the no-action
cursor in some situations.
This commit is contained in:
Bryan Housel
2017-12-25 23:11:00 -05:00
parent 009d7b0d65
commit ee617779a4
3 changed files with 4 additions and 14 deletions
-10
View File
@@ -49,16 +49,6 @@
cursor: url(img/cursor-select-remove.png), pointer; /* FF */
}
#map .point:active,
#map .vertex:active,
#map .line:active,
#map .area:active,
#map .midpoint:active,
#map .mode-select .selected {
cursor: pointer; /* Opera */
cursor: url(img/cursor-select-acting.png), pointer; /* FF */
}
.mode-draw-line #map,
.mode-draw-area #map,
.mode-add-line #map,
+1 -1
View File
@@ -41,7 +41,7 @@ export function behaviorDrawWay(context, wayId, index, mode, startGraph) {
function move(datum) {
var loc;
var target = datum && datum.id && context.hasEntity(datum.id);
if (target && target.type === 'node') { // snap to node
if (datum.loc) { // snap to node/vertex - a real entity or a nope target with a `loc`
loc = datum.loc;
} else if (target && target.type === 'way') { // snap to way
var choice = geoChooseEdge(
+3 -3
View File
@@ -144,9 +144,9 @@ export function modeDragNode(context) {
var d = datum();
var target = d && d.id && context.hasEntity(d.id);
if (target && target.type === 'node') {
loc = target.loc;
} else if (target && target.type === 'way') {
if (d.loc) { // snap to node/vertex - a real entity or a nope target with a `loc`
loc = d.loc;
} else if (target && target.type === 'way') { // snap to way
var choice = geoChooseEdge(
context.childNodes(target), context.mouse(), context.projection, entity.id
);