mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
increased repaint hack time
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ public class MainFrame extends JFrame implements IView {
|
|||||||
super.setVisible(b);
|
super.setVisible(b);
|
||||||
// TODO: hack to prevent painting issues in the scroll bar rulers. Find
|
// TODO: hack to prevent painting issues in the scroll bar rulers. Find
|
||||||
// a better fix if possible.
|
// a better fix if possible.
|
||||||
Timer timer = new Timer(50, new ActionListener() {
|
Timer timer = new Timer(200, new ActionListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
|||||||
+3
@@ -73,6 +73,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
private Map<IDIYComponent<?>, Area> componentAreaMap;
|
private Map<IDIYComponent<?>, Area> componentAreaMap;
|
||||||
private Project currentProject;
|
private Project currentProject;
|
||||||
private Map<String, List<ComponentType>> componentTypes;
|
private Map<String, List<ComponentType>> componentTypes;
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private Map<Class<? extends IDIYComponent>, ComponentType> componentTypeMap;
|
private Map<Class<? extends IDIYComponent>, ComponentType> componentTypeMap;
|
||||||
private List<IPlugIn> plugIns;
|
private List<IPlugIn> plugIns;
|
||||||
|
|
||||||
@@ -738,8 +739,10 @@ public class Presenter implements IPlugInPort {
|
|||||||
Point controlPoint = component.getControlPoint(j);
|
Point controlPoint = component.getControlPoint(j);
|
||||||
int x = controlPoint.x + point.x;
|
int x = controlPoint.x + point.x;
|
||||||
int y = controlPoint.y + point.y;
|
int y = controlPoint.y + point.y;
|
||||||
|
if (snapToGrid) {
|
||||||
x = (int) (Math.round(x / Constants.GRID) * Constants.GRID);
|
x = (int) (Math.round(x / Constants.GRID) * Constants.GRID);
|
||||||
y = (int) (Math.round(y / Constants.GRID) * Constants.GRID);
|
y = (int) (Math.round(y / Constants.GRID) * Constants.GRID);
|
||||||
|
}
|
||||||
controlPoint.setLocation(x, y);
|
controlPoint.setLocation(x, y);
|
||||||
component.setControlPoint(controlPoint, j);
|
component.setControlPoint(controlPoint, j);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user