summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorAdeline CARNIS <adeline.carnis@scilab-enterprises.com>2016-10-12 16:48:04 +0200
committerAntoine ELIAS <antoine.elias@scilab-enterprises.com>2016-11-04 15:35:23 +0100
commitd4e6dbd1f52a6a85ff6d1c5362f70a622534161b (patch)
treeed0dccbc910ecfa0aaee39ce617433c7fe95c564 /scilab
parentb6b336a96976e87a6e79dd2e292ef6e7336197b0 (diff)
downloadscilab-d4e6dbd1f52a6a85ff6d1c5362f70a622534161b.zip
scilab-d4e6dbd1f52a6a85ff6d1c5362f70a622534161b.tar.gz
bug #10981 fixed - When the view property of Axes object is set at 2d, the rotation becomes impossible.
Change-Id: Id3e66e3c04bd9dfbd223749a87ea1375bc395b4f
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES.md4
-rw-r--r--scilab/modules/graphics/tests/nonreg_tests/bug_10981.tst20
-rw-r--r--scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java10
3 files changed, 30 insertions, 4 deletions
diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md
index 39973f7..6dc5476 100644
--- a/scilab/CHANGES.md
+++ b/scilab/CHANGES.md
@@ -197,6 +197,9 @@ will zoom all axes in the current figure.
197* The graphics entity "Datatip" has a new property `detached_position` which accepts `[]` 197* The graphics entity "Datatip" has a new property `detached_position` which accepts `[]`
198or a 3-components vector to set the position in axes coordinates to draw the datatip text box. 198or a 3-components vector to set the position in axes coordinates to draw the datatip text box.
199* `MPI_Create_comm` create a new communicator from MPI_COMM_WORLD using MPI world ranks. 199* `MPI_Create_comm` create a new communicator from MPI_COMM_WORLD using MPI world ranks.
200* The `grand` non-free `fsultra` generator was removed.
201* The original `rpoly` algorithm was removed in favor of a C++11 implementation
202* When the view property of Axes object is set at `2d`, the rotation becomes impossible.
200 203
201Help pages: 204Help pages:
202----------- 205-----------
@@ -329,6 +332,7 @@ Bug Fixes
329* [#9876](http://bugzilla.scilab.org/show_bug.cgi?id=9876): Creating a complex structure with multiple hierarchy level and size failed. 332* [#9876](http://bugzilla.scilab.org/show_bug.cgi?id=9876): Creating a complex structure with multiple hierarchy level and size failed.
330* [#9912](http://bugzilla.scilab.org/show_bug.cgi?id=9912): In case of missing translated help page, the default en_US was sometimes ignored 333* [#9912](http://bugzilla.scilab.org/show_bug.cgi?id=9912): In case of missing translated help page, the default en_US was sometimes ignored
331* [#10116](http://bugzilla.scilab.org/show_bug.cgi?id=10116): `for h = H, .., end` could not be used when H is a vector of graphic handles 334* [#10116](http://bugzilla.scilab.org/show_bug.cgi?id=10116): `for h = H, .., end` could not be used when H is a vector of graphic handles
335* [#10981](http://bugzilla.scilab.org/show_bug.cgi?id=10981): When the view property of Axes object is set at 2d, the rotation becomes impossible.
332* [#11375](http://bugzilla.scilab.org/show_bug.cgi?id=11375): When a localized help subdirectory has only a CHAPTER file specifying the section title, it was ignored. 336* [#11375](http://bugzilla.scilab.org/show_bug.cgi?id=11375): When a localized help subdirectory has only a CHAPTER file specifying the section title, it was ignored.
333* [#11692](http://bugzilla.scilab.org/show_bug.cgi?id=11692): The summary of a help section built from both default en_US and localized files was never sorted overall. 337* [#11692](http://bugzilla.scilab.org/show_bug.cgi?id=11692): The summary of a help section built from both default en_US and localized files was never sorted overall.
334* [#11959](http://bugzilla.scilab.org/show_bug.cgi?id=11959): Allow "Zoom Area" to be clicked out of axes 338* [#11959](http://bugzilla.scilab.org/show_bug.cgi?id=11959): Allow "Zoom Area" to be clicked out of axes
diff --git a/scilab/modules/graphics/tests/nonreg_tests/bug_10981.tst b/scilab/modules/graphics/tests/nonreg_tests/bug_10981.tst
new file mode 100644
index 0000000..6942ceb
--- /dev/null
+++ b/scilab/modules/graphics/tests/nonreg_tests/bug_10981.tst
@@ -0,0 +1,20 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2008 - INRIA - Vincent COUVERT
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7//
8// <-- TEST WITH GRAPHIC -->
9// <-- INTERACTIVE TEST -->
10//
11// <-- Non-regression test for bug 10981 -->
12//
13// <-- Bugzilla URL -->
14// http://bugzilla.scilab.org/show_bug.cgi?id=10981
15//
16// <-- Short Description -->
17// Avoid rotate 2d plot
18
19plot2d();
20//plot must not be rotatable \ No newline at end of file
diff --git a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java
index 6bee346..341c045 100644
--- a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java
+++ b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/interaction/DragZoomRotateInteraction.java
@@ -267,10 +267,12 @@ public class DragZoomRotateInteraction extends FigureInteraction {
267 int dy = e.getY() - previousEvent.getY(); 267 int dy = e.getY() - previousEvent.getY();
268 268
269 for (Axes axes : currentAxes) { 269 for (Axes axes : currentAxes) {
270 Double[] angles = axes.getRotationAngles(); 270 if (axes.getView() != 0) {
271 angles[0] -= dy / 4.0; 271 Double[] angles = axes.getRotationAngles();
272 angles[1] -= Math.signum(Math.sin(Math.toRadians(angles[0]))) * (dx / 4.0); 272 angles[0] -= dy / 4.0;
273 GraphicController.getController().setProperty(axes.getIdentifier(), GraphicObjectProperties.__GO_ROTATION_ANGLES__, angles); 273 angles[1] -= Math.signum(Math.sin(Math.toRadians(angles[0]))) * (dx / 4.0);
274 GraphicController.getController().setProperty(axes.getIdentifier(), GraphicObjectProperties.__GO_ROTATION_ANGLES__, angles);
275 }
274 } 276 }
275 } 277 }
276 278