apply hw acceleration preferences on start

This commit is contained in:
Branislav Stojkovic
2019-01-18 23:38:33 +01:00
parent 813baee504
commit 08bc4f5170
2 changed files with 4 additions and 1 deletions
@@ -74,7 +74,7 @@ public class CanvasPanel extends JComponent implements Autoscroll {
private Image bufferImage; private Image bufferImage;
private GraphicsConfiguration screenGraphicsConfiguration; private GraphicsConfiguration screenGraphicsConfiguration;
public boolean useHardwareAcceleration = false; public boolean useHardwareAcceleration = ConfigurationManager.getInstance().readBoolean(IPlugInPort.HARDWARE_ACCELERATION, false);
// static final EnumSet<DrawOption> DRAW_OPTIONS = // static final EnumSet<DrawOption> DRAW_OPTIONS =
// EnumSet.of(DrawOption.GRID, // EnumSet.of(DrawOption.GRID,
@@ -240,6 +240,9 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
new RulerScrollPane(getCanvasPanel(), new ProjectDrawingProvider(plugInPort, true, false), new Size(1d, new RulerScrollPane(getCanvasPanel(), new ProjectDrawingProvider(plugInPort, true, false), new Size(1d,
SizeUnit.cm).convertToPixels(), new Size(1d, SizeUnit.in).convertToPixels()); SizeUnit.cm).convertToPixels(), new Size(1d, SizeUnit.in).convertToPixels());
boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY, true); boolean metric = ConfigurationManager.getInstance().readBoolean(Presenter.METRIC_KEY, true);
boolean useHardwareAcceleration = ConfigurationManager.getInstance().readBoolean(IPlugInPort.HARDWARE_ACCELERATION, false);
scrollPane.setUseHardwareAcceleration(useHardwareAcceleration);
scrollPane.setMetric(metric); scrollPane.setMetric(metric);
scrollPane.setWheelScrollingEnabled(true); scrollPane.setWheelScrollingEnabled(true);