allow the rotate operation also for closed multipolygon members

closes #1718
This commit is contained in:
tyr
2014-01-10 23:38:29 +01:00
committed by John Firebaugh
parent 2b64678b8f
commit bde045d30c

View File

@@ -6,9 +6,18 @@ iD.operations.Rotate = function(selectedIDs, context) {
};
operation.available = function() {
return selectedIDs.length === 1 &&
context.entity(entityId).type === 'way' &&
context.geometry(entityId) === 'area';
var graph = context.graph(),
entity = graph.entity(entityId);
if (selectedIDs.length !== 1 ||
entity.type !== 'way')
return false;
if (context.geometry(entityId) === 'area')
return true;
if (entity.isClosed() &&
graph.parentRelations(entity).some(function(r) { return r.isMultipolygon(); }))
return true;
return false;
};
operation.disabled = function() {