mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +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>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
<description>Improved performance of "Highlight Connected Areas" feature</description>
|
<description>Improved performance of "Highlight Connected Areas" feature</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</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>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Older files that contain "Open Jack 1/4" components sometimes open with the jacks rotated the wrong way</description>
|
<description>Older files that contain "Open Jack 1/4" components sometimes open with the jacks rotated the wrong way</description>
|
||||||
|
|||||||
@@ -326,15 +326,17 @@ public class CanvasPanel extends JComponent implements Autoscroll {
|
|||||||
|
|
||||||
// Autoscroll
|
// Autoscroll
|
||||||
|
|
||||||
|
private int autoScrollSize = 100;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void autoscroll(Point cursorLocn) {
|
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
|
@Override
|
||||||
public Insets getAutoscrollInsets() {
|
public Insets getAutoscrollInsets() {
|
||||||
Rectangle rect = getVisibleRect();
|
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) {
|
public void setUseHardwareAcceleration(boolean useHardwareAcceleration) {
|
||||||
|
|||||||
Reference in New Issue
Block a user