summaryrefslogtreecommitdiffstats
path: root/scilab
diff options
context:
space:
mode:
authorClément DAVID <clement.david@scilab.org>2010-05-10 15:38:06 +0200
committerBruno JOFRET <bruno.jofret@scilab.org>2010-05-19 18:09:32 +0200
commit14a92190dcba19d21a4c64e4095ce695556cf6cc (patch)
tree0bfe92ccd9ddaf991f5bc111d2cd64f88962c4f6 /scilab
parentc8750984274b190ff9ebdc96b1696e6e309f9fcd (diff)
downloadscilab-14a92190dcba19d21a4c64e4095ce695556cf6cc.zip
scilab-14a92190dcba19d21a4c64e4095ce695556cf6cc.tar.gz
Xcos: correct loading of rotated blocks
Due to compatibility functions, rotated blocks were not restored properly. The decode method must not modify valid values. Bug: 7043 Change-Id: I6b45ae4dc0f7e6c0711a0c6ab2413e8afa8b4119
Diffstat (limited to 'scilab')
-rw-r--r--scilab/CHANGES_5.3.X3
-rw-r--r--scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicPortCodec.java8
2 files changed, 11 insertions, 0 deletions
diff --git a/scilab/CHANGES_5.3.X b/scilab/CHANGES_5.3.X
index 0be55c3..99690dd 100644
--- a/scilab/CHANGES_5.3.X
+++ b/scilab/CHANGES_5.3.X
@@ -159,6 +159,9 @@ Xcos:
159 159
160* bug 7099 fixed - xml2modelica called ocamlrun (wrong dependency on Windows). 160* bug 7099 fixed - xml2modelica called ocamlrun (wrong dependency on Windows).
161 161
162* bug 7053 fixed - Rotated saved blocks were not loaded with the right rotation
163 value.
164
162Dynamic link: 165Dynamic link:
163============= 166=============
164 167
diff --git a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicPortCodec.java b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicPortCodec.java
index 837439e..5473a1f 100644
--- a/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicPortCodec.java
+++ b/scilab/modules/xcos/src/java/org/scilab/modules/xcos/io/codec/BasicPortCodec.java
@@ -16,6 +16,7 @@ package org.scilab.modules.xcos.io.codec;
16import java.util.Map; 16import java.util.Map;
17 17
18import org.scilab.modules.graph.utils.StyleMap; 18import org.scilab.modules.graph.utils.StyleMap;
19import org.scilab.modules.xcos.block.BasicBlock;
19import org.scilab.modules.xcos.io.XcosObjectCodec; 20import org.scilab.modules.xcos.io.XcosObjectCodec;
20import org.scilab.modules.xcos.port.BasicPort; 21import org.scilab.modules.xcos.port.BasicPort;
21import org.scilab.modules.xcos.port.Orientation; 22import org.scilab.modules.xcos.port.Orientation;
@@ -158,6 +159,13 @@ public class BasicPortCodec extends XcosObjectCodec {
158 159
159 flipped = Boolean.parseBoolean(map.get(XcosConstants.STYLE_FLIP)); 160 flipped = Boolean.parseBoolean(map.get(XcosConstants.STYLE_FLIP));
160 mirrored = Boolean.parseBoolean(map.get(XcosConstants.STYLE_MIRROR)); 161 mirrored = Boolean.parseBoolean(map.get(XcosConstants.STYLE_MIRROR));
162
163 final int baseAngle = orientation.getRelativeAngle(((BasicBlock) obj
164 .getParent()).getAngle(), obj.getClass(), flipped, mirrored);
165
166 if (rotation == baseAngle) {
167 return;
168 }
161 169
162 // Calculate the rotation for this kind of port. 170 // Calculate the rotation for this kind of port.
163 rotation = orientation.getAbsoluteAngle(obj.getClass(), flipped, mirrored); 171 rotation = orientation.getAbsoluteAngle(obj.getClass(), flipped, mirrored);