mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
shift for horizontal scroll
fixed issue with size calculation when zoomed
This commit is contained in:
@@ -99,10 +99,12 @@ public interface ISelectionProcessor {
|
||||
/**
|
||||
* Returns the minimum rectangle containing all selected components, or null if none exists.
|
||||
* Rectangle is scaled by the current zoom level.
|
||||
*
|
||||
* @param applyZoom
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Rectangle2D getSelectionBounds();
|
||||
Rectangle2D getSelectionBounds(boolean applyZoom);
|
||||
|
||||
/**
|
||||
* Moves selection for the specified offset.
|
||||
|
||||
@@ -859,7 +859,7 @@ public class Presenter implements IPlugInPort {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Rectangle2D getSelectionBounds() {
|
||||
public Rectangle2D getSelectionBounds(boolean applyZoom) {
|
||||
if (selectedComponents == null || selectedComponents.isEmpty())
|
||||
return null;
|
||||
|
||||
@@ -871,7 +871,7 @@ public class Presenter implements IPlugInPort {
|
||||
else
|
||||
LOG.info("Area is null");
|
||||
}
|
||||
if (drawingManager.getZoomLevel() != 1) {
|
||||
if (drawingManager.getZoomLevel() != 1 && applyZoom) {
|
||||
totalArea
|
||||
.transform(AffineTransform.getScaleInstance(drawingManager.getZoomLevel(), drawingManager.getZoomLevel()));
|
||||
}
|
||||
@@ -1881,7 +1881,7 @@ public class Presenter implements IPlugInPort {
|
||||
if (selectedComponents.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Rectangle2D rect = getSelectionBounds();
|
||||
Rectangle2D rect = getSelectionBounds(false);
|
||||
|
||||
double width = rect.getWidth();
|
||||
double height = rect.getHeight();
|
||||
|
||||
Reference in New Issue
Block a user