diff options
| author | Maxime Porhel | 2015-08-27 07:51:33 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2015-08-27 08:54:25 +0000 |
| commit | 0b09358624894ac60e5cdcf325a41d44e831f9e0 (patch) | |
| tree | 3c8d1848d12f8f9cc4fa9e036e0bf7fb4f79a5a0 | |
| parent | 3978c220db1b97c86d793888c9215622fb8a3a0c (diff) | |
| download | org.eclipse.sirius-0b09358624894ac60e5cdcf325a41d44e831f9e0.tar.gz org.eclipse.sirius-0b09358624894ac60e5cdcf325a41d44e831f9e0.tar.xz org.eclipse.sirius-0b09358624894ac60e5cdcf325a41d44e831f9e0.zip | |
[472033] Do not draw the drop shadow of a detached figure
If a figure is removed from its parent, it will not be drawn so do not
draw the drop shadow borders referencing it.
Bug: 472033
Change-Id: Icd0cfb944e0374547cdf2b9e865913f2af7d7e58
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AlphaDropShadowBorder.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AlphaDropShadowBorder.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AlphaDropShadowBorder.java index f61786c6aa..f0ca718c4b 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AlphaDropShadowBorder.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/figure/AlphaDropShadowBorder.java @@ -56,10 +56,12 @@ public class AlphaDropShadowBorder extends AbstractBackground implements DropSha this.shape = shape; } + @Override public void setShouldDrawDropShadow(boolean drawDropShadow) { shouldDrawShadow = drawDropShadow; } + @Override public boolean shouldDrawDropShadow() { return shouldDrawShadow; } @@ -81,6 +83,7 @@ public class AlphaDropShadowBorder extends AbstractBackground implements DropSha return insetsNew; } + @Override public Insets getTransparentInsets(IFigure figure) { Insets insetsNew = new Insets(); insetsNew.top = 0; @@ -92,7 +95,7 @@ public class AlphaDropShadowBorder extends AbstractBackground implements DropSha @Override public void paintBackground(IFigure figure, Graphics graphics, Insets insets) { - if (shouldDrawDropShadow()) { + if (shouldDrawDropShadow() && shape != null && shape.getParent() != null) { int ORIGINALALPHA = graphics.getAlpha(); graphics.pushState(); graphics.setBackgroundColor(SHADOW_COLOR); @@ -121,7 +124,6 @@ public class AlphaDropShadowBorder extends AbstractBackground implements DropSha } graphics.setAlpha(ORIGINALALPHA); graphics.popState(); - } } } |
