-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disables the lock when the camera is dynamic #353
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
/******************************************************************************************************* | ||
* | ||
* CameraDefinition.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform | ||
* . | ||
* CameraDefinition.java, in gama.core, is part of the source code of the GAMA modeling and simulation platform . | ||
* | ||
* (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) | ||
* | ||
|
@@ -95,7 +94,7 @@ | |
if (temp instanceof String pos) { | ||
// If it is a symbolic position | ||
double coeff = 1.4; | ||
if ((scope instanceof GraphicsScope gs) && (gs.getGraphics() != null)) { | ||
if (scope instanceof GraphicsScope gs && gs.getGraphics() != null) { | ||
coeff = gs.getGraphics().getSurface().getData().getCameraDistanceCoefficient(); | ||
} | ||
double w = scope.getSimulation().getWidth(); | ||
|
@@ -144,7 +143,7 @@ | |
*/ | ||
@Override | ||
public boolean setLocation(final GamaPoint loc) { | ||
if (!isInteractive() || loc == null) return false; | ||
if (isLocked() || isDynamic() || loc == null) return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Complex Conditional |
||
locationAttribute = new ConstantAttribute<>(loc.yNegated()); | ||
return current.setLocation(loc); | ||
} | ||
|
@@ -159,7 +158,7 @@ | |
*/ | ||
@Override | ||
public boolean setTarget(final GamaPoint loc) { | ||
if (!isInteractive() || loc == null) return false; | ||
if (isLocked() || isDynamic() || loc == null) return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Complex Conditional |
||
targetAttribute = new ConstantAttribute<>(loc.yNegated()); | ||
return current.setTarget(loc); | ||
} | ||
|
@@ -180,7 +179,7 @@ | |
public Integer getLens() { return lens.get(); } | ||
|
||
@Override | ||
public Boolean isInteractive() { return !locked.get() && !isDynamic(); } | ||
public Boolean isLocked() { return locked.get(); } | ||
|
||
/** | ||
* Sets the interactive. | ||
|
@@ -189,11 +188,11 @@ | |
* the new interactive | ||
*/ | ||
@Override | ||
public void setInteractive(final Boolean b) { this.locked = new ConstantAttribute<>(b == null ? false : !b); } | ||
public void setLocked(final Boolean b) { this.locked = new ConstantAttribute<>(b == null ? false : b); } | ||
Check warning on line 191 in gama.core/src/gama/core/outputs/layers/properties/CameraDefinition.java GitHub Actions / SpotBugsBX_UNBOXING_IMMEDIATELY_REBOXED
Raw output
|
||
|
||
@Override | ||
public boolean setDistance(final Double d) { | ||
if (!isInteractive() || d == null) return false; | ||
if (isLocked() || isDynamic() || d == null) return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❌ New issue: Complex Conditional |
||
distanceAttribute = new ConstantAttribute<>(d); | ||
return current.setDistance(d); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ New issue: Bumpy Road Ahead
update has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function
Suppress