Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class ScalableFreeformLayeredPane extends FreeformLayeredPane implements
private final boolean useScaledGraphics;

public ScalableFreeformLayeredPane() {
this(false);
this(InternalDraw2dUtils.useScaledGraphicsByDefault());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class ScalableLayeredPane extends LayeredPane implements IScalablePane {
private final boolean useScaledGraphics;

public ScalableLayeredPane() {
this(false);
this(InternalDraw2dUtils.useScaledGraphicsByDefault());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public double getScale() {
@Deprecated(forRemoval = true, since = "2026-03")
@Override
public boolean useScaledGraphics() {
return false;
return InternalDraw2dUtils.useScaledGraphicsByDefault();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public class InternalDraw2dUtils {
*/
private static final String DRAW2D_ENABLE_AUTOSCALE = "draw2d.enableAutoscale"; //$NON-NLS-1$

/**
* System property that controls if ScaledGraphcis are supposed to be used
* instead of SWTGraphics by default.
* <p>
* The current default is "false".
*/
private static final String DRAW2D_SCALEDGRAPHICS_BY_DEFAULT = "draw2d.scaledGraphicsByDefault"; //$NON-NLS-1$

/**
* Internal flag for fetching the shell zoom
*/
Expand All @@ -54,10 +62,17 @@ public class InternalDraw2dUtils {
&& Boolean.parseBoolean(System.getProperty(DRAW2D_ENABLE_AUTOSCALE, Boolean.TRUE.toString()))
&& SWT.getVersion() >= 4971; // SWT 2025-12 release or higher

private static final boolean useScaledGraphicsByDefault = Boolean
.parseBoolean(System.getProperty(DRAW2D_SCALEDGRAPHICS_BY_DEFAULT, Boolean.FALSE.toString()));

public static boolean isAutoScaleEnabled() {
return enableAutoScale;
}

public static boolean useScaledGraphicsByDefault() {
return useScaledGraphicsByDefault;
}

public static void configureForAutoscalingMode(Control control, Consumer<Double> zoomConsumer) {
if (control == null || !isAutoScaleEnabled()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class ScalableFreeformRootEditPart extends FreeformGraphicalRootEditPart
* Constructor for ScalableFreeformRootEditPart
*/
public ScalableFreeformRootEditPart() {
this(false);
this(InternalDraw2dUtils.useScaledGraphicsByDefault());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public Dimension getPreferredSize(int wHint, int hHint) {
* Constructor for ScalableRootEditPart
*/
public ScalableRootEditPart() {
this(false);
this(InternalDraw2dUtils.useScaledGraphicsByDefault());
}

/**
Expand Down
Loading