Skip to content

Commit

Permalink
See #2761. Prevents overlays to rotate when the display rotates
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Mar 27, 2022
1 parent 32a4f40 commit d38b6eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Expand Up @@ -97,7 +97,7 @@
type = IType.GEOMETRY,
optional = true,
doc = @doc (
deprecated = "Use 'camera default target: the_agent' to achieve the same effect",
deprecated = "Use 'camera default target: the_agent' to achieve the same effect. And please note that this possibility does not exist on Java2D anymore",
value = "the geometry (or agent) on which the display will (dynamically) focus")),
// WARNING VALIDER EN VERIFIANT LE TYPE DU DISPLAY
@facet (
Expand Down
Expand Up @@ -109,11 +109,11 @@
type = IType.LABEL,
optional = true,
doc = @doc ("Human readable title of the layer")),
@facet (
name = IKeyword.FOCUS,
type = IType.AGENT,
optional = true,
doc = @doc ("the agent on which the camera will be focused (it is dynamically computed)")),
// @facet (
// name = IKeyword.FOCUS,
// type = IType.AGENT,
// optional = true,
// doc = @doc ("the agent on which the camera will be focused (it is dynamically computed)")),
@facet (
name = IKeyword.ASPECT,
type = IType.ID,
Expand Down
Expand Up @@ -121,12 +121,16 @@ public void draw(final OpenGL gl) {
gl.rotateModel();
for (LayerObject layer : layers.values()) {
if (layer != null && !layer.isInvalid()) {
// AD added to prevent overlays to rotate
if (layer.isOverlay()) { gl.pushIdentity(GLMatrixFunc.GL_MODELVIEW); }
try {
layer.lock();
layer.draw(gl);
} catch (final RuntimeException r) {
DEBUG.ERR("Runtime error " + r.getMessage() + " in OpenGL loop");
r.printStackTrace();
} finally {
if (layer.isOverlay()) { gl.pop(GLMatrixFunc.GL_MODELVIEW); }
}
}
}
Expand Down

0 comments on commit d38b6eb

Please sign in to comment.