mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Faster auto-scroll while dragging a component outside the visible
portion of the canvas
This commit is contained in:
@@ -2906,6 +2906,10 @@
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Improved performance of "Highlight Connected Areas" feature</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>Faster auto-scroll while dragging a component outside the visible portion of the canvas</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Older files that contain "Open Jack 1/4" components sometimes open with the jacks rotated the wrong way</description>
|
||||
|
||||
@@ -324,17 +324,19 @@ public class CanvasPanel extends JComponent implements Autoscroll {
|
||||
// });
|
||||
}
|
||||
|
||||
// Autoscroll
|
||||
// Autoscroll
|
||||
|
||||
private int autoScrollSize = 100;
|
||||
|
||||
@Override
|
||||
public void autoscroll(Point cursorLocn) {
|
||||
scrollRectToVisible(new Rectangle(cursorLocn.x - 15, cursorLocn.y - 15, 30, 30));
|
||||
scrollRectToVisible(new Rectangle(cursorLocn.x - autoScrollSize, cursorLocn.y - autoScrollSize, autoScrollSize * 2, autoScrollSize * 2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getAutoscrollInsets() {
|
||||
Rectangle rect = getVisibleRect();
|
||||
return new Insets(rect.y - 15, rect.x - 15, rect.y + rect.height + 15, rect.x + rect.width + 15);
|
||||
return new Insets(rect.y - autoScrollSize, rect.x - autoScrollSize, rect.y + rect.height + autoScrollSize, rect.x + rect.width + autoScrollSize);
|
||||
}
|
||||
|
||||
public void setUseHardwareAcceleration(boolean useHardwareAcceleration) {
|
||||
|
||||
Reference in New Issue
Block a user