Properly disable more operations for single nodes that aren't visible

This commit is contained in:
Quincy Morgan
2020-06-05 14:22:50 -04:00
parent 251f9825f4
commit 02f8849bd0
7 changed files with 7 additions and 7 deletions

View File

@@ -113,7 +113,7 @@ export function operationCopy(context, selectedIDs) {
var extent = nodes.reduce(function(extent, node) {
return extent.extend(node.extent(context.graph()));
}, geoExtent());
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
}
return false;

View File

@@ -72,7 +72,7 @@ export function operationDelete(context, selectedIDs) {
operation.disabled = function() {
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (someMissing()) {
return 'not_downloaded';

View File

@@ -57,7 +57,7 @@ export function operationExtract(context, selectedIDs) {
operation.disabled = function () {
if (_extent && _extent.area() && _extent.percentContainedIn(context.map().extent()) < 0.8) {
if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (selectedIDs.some(function(entityID) {
return context.graph().geometry(entityID) === 'vertex' && context.hasHiddenConnections(entityID);

View File

@@ -26,7 +26,7 @@ export function operationMove(context, selectedIDs) {
operation.disabled = function() {
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (someMissing()) {
return 'not_downloaded';

View File

@@ -89,7 +89,7 @@ export function operationOrthogonalize(context, selectedIDs) {
return 'multiple_blockers';
}
return actionDisableds[0];
} else if (_type !== 'corner' &&
} else if (_extent &&
_extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (someMissing()) {

View File

@@ -44,7 +44,7 @@ export function operationReflect(context, selectedIDs, axis) {
// don't cache this because the visible extent could change
operation.disabled = function() {
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (someMissing()) {
return 'not_downloaded';

View File

@@ -26,7 +26,7 @@ export function operationRotate(context, selectedIDs) {
operation.disabled = function() {
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
return 'too_large';
} else if (someMissing()) {
return 'not_downloaded';