mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 13:38:26 +02:00
Make Reflect/Rotate unavailable for strictly linear features
This commit is contained in:
@@ -31,8 +31,13 @@ export function operationReflect(selectedIDs, context, axis) {
|
||||
|
||||
|
||||
operation.available = function() {
|
||||
return selectedIDs.length > 1 ||
|
||||
context.entity(selectedIDs[0]).type !== 'node';
|
||||
return _.some(selectedIDs, hasArea);
|
||||
|
||||
function hasArea(id) {
|
||||
var entity = context.entity(id);
|
||||
return (entity.type === 'way' && entity.isClosed()) ||
|
||||
(entity.type ==='relation' && entity.isMultipolygon());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,13 @@ export function operationRotate(selectedIDs, context) {
|
||||
|
||||
|
||||
operation.available = function() {
|
||||
return selectedIDs.length > 1 ||
|
||||
context.entity(selectedIDs[0]).type !== 'node';
|
||||
return _.some(selectedIDs, hasArea);
|
||||
|
||||
function hasArea(id) {
|
||||
var entity = context.entity(id);
|
||||
return (entity.type === 'way' && entity.isClosed()) ||
|
||||
(entity.type ==='relation' && entity.isMultipolygon());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user