increased repaint hack time

This commit is contained in:
bancika
2011-01-06 00:39:52 +00:00
parent e612b39b26
commit 53433f0836
2 changed files with 6 additions and 3 deletions
@@ -97,7 +97,7 @@ public class MainFrame extends JFrame implements IView {
super.setVisible(b);
// TODO: hack to prevent painting issues in the scroll bar rulers. Find
// a better fix if possible.
Timer timer = new Timer(50, new ActionListener() {
Timer timer = new Timer(200, new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -73,6 +73,7 @@ public class Presenter implements IPlugInPort {
private Map<IDIYComponent<?>, Area> componentAreaMap;
private Project currentProject;
private Map<String, List<ComponentType>> componentTypes;
@SuppressWarnings("unchecked")
private Map<Class<? extends IDIYComponent>, ComponentType> componentTypeMap;
private List<IPlugIn> plugIns;
@@ -738,8 +739,10 @@ public class Presenter implements IPlugInPort {
Point controlPoint = component.getControlPoint(j);
int x = controlPoint.x + point.x;
int y = controlPoint.y + point.y;
x = (int) (Math.round(x / Constants.GRID) * Constants.GRID);
y = (int) (Math.round(y / Constants.GRID) * Constants.GRID);
if (snapToGrid) {
x = (int) (Math.round(x / Constants.GRID) * Constants.GRID);
y = (int) (Math.round(y / Constants.GRID) * Constants.GRID);
}
controlPoint.setLocation(x, y);
component.setControlPoint(controlPoint, j);
}