Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2016-08-02 07:22:38 +0000
committerLaurent Redor2016-08-03 13:48:09 +0000
commitc82df54339b20693bfc37094442576d3c1605c74 (patch)
treecae001f136b67944cab37c51d8c174f4ed904b5a
parentf475b0373bafcc5f4877d76e066b5627bd7b2df1 (diff)
downloadorg.eclipse.sirius-c82df54339b20693bfc37094442576d3c1605c74.tar.gz
org.eclipse.sirius-c82df54339b20693bfc37094442576d3c1605c74.tar.xz
org.eclipse.sirius-c82df54339b20693bfc37094442576d3c1605c74.zip
[491913] Fix regression of previous commit- Pb of Pattern coordinates
The previous commit [1] has clarified the coordinates use (x, y ,width , height). But some impacts have been forgotten: Pattern constructor call, topToBottom GradientPaint , oblique Pattern and leftToRight Pattern. [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/diff/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java?id=ebc68755874dabd8873a839806689b5021cdd59b Bug: 491913 Change-Id: I0b6fc8477d22a9bd0cb4e3e7b70428ae46191151 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java6
-rw-r--r--plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java2
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java
index ae319b71ec..129b3f5ddb 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/GradientHelper.java
@@ -131,7 +131,7 @@ public final class GradientHelper {
* @return the corresponding pattern.
*/
public static Pattern getGradientLeftToRight(final Rectangle bounds, final Color backgroundColor, final Color gradientColor) {
- return VisualBindingManager.getDefault().getPatternFromValue(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y, backgroundColor, gradientColor);
+ return VisualBindingManager.getDefault().getPatternFromValue(bounds.x, bounds.y, bounds.width, 0, backgroundColor, gradientColor);
}
/**
@@ -160,7 +160,7 @@ public final class GradientHelper {
if (gradientZoneHeight != bounds.height) {
y = bounds.y - (i - bounds.height) / 2;
}
- return VisualBindingManager.getDefault().getPatternFromValue(x, y, x + gradientZoneWidth, y + gradientZoneHeight, backgroundColor, gradientColor);
+ return VisualBindingManager.getDefault().getPatternFromValue(x, y, gradientZoneWidth, gradientZoneHeight, backgroundColor, gradientColor);
}
/**
@@ -234,6 +234,6 @@ public final class GradientHelper {
* @return the correesponding pattern.
*/
public static GradientPaint getGradientPaintTopToBottom(final Rectangle bounds, final Color backgroundColor, final Color gradientColor) {
- return VisualBindingManager.getDefault().getGradientPaintFromValue(bounds.x, bounds.y, bounds.x, bounds.y + bounds.height, backgroundColor, gradientColor);
+ return VisualBindingManager.getDefault().getGradientPaintFromValue(bounds.x, bounds.y, 0, bounds.height, backgroundColor, gradientColor);
}
}
diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java
index f5c768ea41..82c9288f8c 100644
--- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java
+++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/api/color/VisualBindingManager.java
@@ -552,7 +552,7 @@ public class VisualBindingManager {
}
public Pattern createPattern() {
- return new Pattern(null, this.x, this.y, this.w, this.h, this.backgroundColor, this.foregroundColor);
+ return new Pattern(null, this.x, this.y, this.x + this.w, this.y + this.h, this.backgroundColor, this.foregroundColor);
}
public GradientPaint createGradientPaint() {

Back to the top