mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
handle no results
This commit is contained in:
@@ -1014,7 +1014,8 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
updateSelection(matching);
|
||||
messageDispatcher.dispatchMessage(EventType.REPAINT);
|
||||
messageDispatcher.dispatchMessage(EventType.SCROLL_TO, getSelectionBounds(true));
|
||||
if (matching.size() > 0)
|
||||
messageDispatcher.dispatchMessage(EventType.SCROLL_TO, getSelectionBounds(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -762,7 +762,8 @@ public class CanvasPlugin implements IPlugIn, ClipboardOwner {
|
||||
case SCROLL_TO:
|
||||
Rectangle visibleRect2 = canvasPanel.getVisibleRect();
|
||||
Rectangle2D targetRect = (Rectangle2D) params[0];
|
||||
canvasPanel.scrollRectToVisible(new Rectangle((int)(targetRect.getCenterX() - visibleRect2.width / 2),
|
||||
if (targetRect != null)
|
||||
canvasPanel.scrollRectToVisible(new Rectangle((int)(targetRect.getCenterX() - visibleRect2.width / 2),
|
||||
(int)(targetRect.getCenterY() - visibleRect2.height / 2), visibleRect2.width, visibleRect2.height));
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user