mirror of
https://github.com/Shiewk/Widgets.git
synced 2026-04-28 11:34:17 +02:00
Fix an alignment issue
This commit is contained in:
@@ -62,8 +62,9 @@ public class EditWidgetPositionsScreen extends AnimatedScreen {
|
|||||||
int factor = alignX ? 2 : 0;
|
int factor = alignX ? 2 : 0;
|
||||||
for (Dimensionable rect : this.getAlignments(widget)) {
|
for (Dimensionable rect : this.getAlignments(widget)) {
|
||||||
if (rect == widget) continue;
|
if (rect == widget) continue;
|
||||||
final double nwx = rect.getX(this.width);
|
final int rectWidth = rect.width();
|
||||||
final double nww = rect.width() * rect.getScaleFactor();
|
final double nwx = Math.min(rect.getX(this.width), this.width - rectWidth);
|
||||||
|
final double nww = rectWidth * rect.getScaleFactor();
|
||||||
if (endX < nwx + factor && endX > nwx - factor){
|
if (endX < nwx + factor && endX > nwx - factor){
|
||||||
return new AlignResult(nwx - width, true);
|
return new AlignResult(nwx - width, true);
|
||||||
} else if (x < nwx + factor && x > nwx - factor){
|
} else if (x < nwx + factor && x > nwx - factor){
|
||||||
@@ -96,8 +97,9 @@ public class EditWidgetPositionsScreen extends AnimatedScreen {
|
|||||||
int factor = alignY ? 2 : 0;
|
int factor = alignY ? 2 : 0;
|
||||||
for (Dimensionable rect : this.getAlignments(widget)) {
|
for (Dimensionable rect : this.getAlignments(widget)) {
|
||||||
if (rect == widget) continue;
|
if (rect == widget) continue;
|
||||||
final double nwy = rect.getY(this.height);
|
final int rectHeight = rect.height();
|
||||||
final double nwh = rect.height() * rect.getScaleFactor();
|
final double nwy = Math.min(rect.getY(this.height), this.height - rectHeight);
|
||||||
|
final double nwh = rectHeight * rect.getScaleFactor();
|
||||||
if (endY < nwy + factor && endY > nwy - factor){
|
if (endY < nwy + factor && endY > nwy - factor){
|
||||||
return new AlignResult(nwy - height, true);
|
return new AlignResult(nwy - height, true);
|
||||||
} else if (y < nwy + factor && y > nwy - factor){
|
} else if (y < nwy + factor && y > nwy - factor){
|
||||||
|
|||||||
Reference in New Issue
Block a user