Skip to content

Commit 23e4bf3

Browse files
committed
Fine Tuned Drop Shadow
- Made Drop Shadow a bit Softer - RectangleDropShadow correctly considers the corner radius for the start of the shadow
1 parent 9d34bc1 commit 23e4bf3

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

org.eclipse.draw2d/src/org/eclipse/draw2d/shadows/EllipseDropShadowBorder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ protected void paintDropShadow(Graphics graphics, Rectangle shadowRect, int size
4444
for (int i = 0; i < size; i++) {
4545
final double progress = (double) i / size;
4646
graphics.setAlpha(calcAlphaValue(progress));
47-
graphics.drawArc(r, 270, 90);
4847
r.x++;
4948
r.y++;
49+
graphics.drawArc(r, 270, 90);
5050
}
5151
}
5252

org.eclipse.draw2d/src/org/eclipse/draw2d/shadows/RectangleDropShadowBorder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ public RectangleDropShadowBorder(int cornerRadius) {
6464

6565
@Override
6666
protected void paintDropShadow(final Graphics graphics, final Rectangle shadowRect, final int size) {
67-
int bottomXStart = shadowRect.x + 1;
68-
int bottomY = shadowRect.y + 1 + shadowRect.height;
69-
final int bottomXEnd = shadowRect.x + shadowRect.width + 1 - cornerStartRadius;
67+
int bottomXStart = shadowRect.x + cornerStartRadius;
68+
int bottomY = shadowRect.y + 2 + shadowRect.height;
69+
final int bottomXEnd = shadowRect.x + shadowRect.width + 2 - cornerStartRadius;
7070

71-
int rightX = shadowRect.x + shadowRect.width + 1;
72-
int rightYStart = shadowRect.y + 1;
73-
final int rightYEnd = shadowRect.y + shadowRect.height + 1 - cornerStartRadius;
71+
int rightX = shadowRect.x + shadowRect.width + 2;
72+
int rightYStart = shadowRect.y + cornerStartRadius;
73+
final int rightYEnd = shadowRect.y + shadowRect.height + 2 - cornerStartRadius;
7474
int cornerDiameter = 2 * cornerStartRadius;
7575

7676
for (int i = 0; i <= size; i++) {

0 commit comments

Comments
 (0)