mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
fixed ghost painting
This commit is contained in:
-2
@@ -1,6 +1,5 @@
|
|||||||
package org.diylc.plugins.canvas;
|
package org.diylc.plugins.canvas;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.GraphicsConfiguration;
|
import java.awt.GraphicsConfiguration;
|
||||||
@@ -60,7 +59,6 @@ class CanvasPanel extends JComponent implements Autoscroll {
|
|||||||
public CanvasPanel(IPlugInPort plugInPort) {
|
public CanvasPanel(IPlugInPort plugInPort) {
|
||||||
super();
|
super();
|
||||||
this.plugInPort = plugInPort;
|
this.plugInPort = plugInPort;
|
||||||
setBackground(Color.white);
|
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
initializeListeners();
|
initializeListeners();
|
||||||
initializeDnD();
|
initializeDnD();
|
||||||
|
|||||||
+3
-2
@@ -45,8 +45,8 @@ public class ProjectPainter {
|
|||||||
// determine which components are invalidated when they are not in the map.
|
// determine which components are invalidated when they are not in the map.
|
||||||
private Map<IDIYComponent<?>, ComponentState> lastDrawnStateMap;
|
private Map<IDIYComponent<?>, ComponentState> lastDrawnStateMap;
|
||||||
|
|
||||||
public boolean antiAliasing = ConfigurationManager.getInstance().readBoolean(
|
public boolean antiAliasing = ConfigurationManager.getInstance().readBoolean(ANTIALIASING_KEY,
|
||||||
ANTIALIASING_KEY, true);
|
true);
|
||||||
|
|
||||||
public ProjectPainter() {
|
public ProjectPainter() {
|
||||||
super();
|
super();
|
||||||
@@ -74,6 +74,7 @@ public class ProjectPainter {
|
|||||||
|
|
||||||
g2dWrapper.setColor(Constants.CANVAS_COLOR);
|
g2dWrapper.setColor(Constants.CANVAS_COLOR);
|
||||||
g2dWrapper.fillRect(0, 0, d.width, d.height);
|
g2dWrapper.fillRect(0, 0, d.width, d.height);
|
||||||
|
g2d.setClip(new Rectangle(new Point(0, 0), d));
|
||||||
|
|
||||||
if (drawOptions.contains(DrawOption.GRID)) {
|
if (drawOptions.contains(DrawOption.GRID)) {
|
||||||
double zoomStep = project.getGridSpacing().convertToPixels() * zoomLevel;
|
double zoomStep = project.getGridSpacing().convertToPixels() * zoomLevel;
|
||||||
|
|||||||
Reference in New Issue
Block a user