fix: fix resize and dragging
- AbstractShape: make bounds protected for subclass access - STriangle: refactor resize logic - SCircle: refactor resize logic (preserves equal dimensions) - SText: add reasonable default bounds for hit testing
This commit is contained in:
@@ -18,7 +18,8 @@ public class SText extends AbstractShape {
|
||||
private final int fontStyle;
|
||||
|
||||
private SText(int x, int y, String text, int fontSize, String fontName, int fontStyle) {
|
||||
super(new Rectangle(x, y, 0, 0));
|
||||
// Initialize with a reasonable default width/height so hit testing works reliably
|
||||
super(new Rectangle(x, y, 100, 20));
|
||||
this.text = normalizeText(text);
|
||||
this.fontSize = fontSize;
|
||||
this.fontName = fontName;
|
||||
|
||||
Reference in New Issue
Block a user