diff --git a/canvas/circle.go b/canvas/circle.go index 6a98f1962e..d691b979a8 100644 --- a/canvas/circle.go +++ b/canvas/circle.go @@ -28,11 +28,12 @@ func (l *Circle) Size() fyne.Size { // Resize sets a new bottom-right position for the circle object // If it has a stroke width this will cause it to Refresh. func (l *Circle) Resize(size fyne.Size) { - l.Position2 = fyne.NewPos(l.Position1.X+size.Width, l.Position1.Y+size.Height) - if l.StrokeWidth == 0 { + if size == l.Size() { return } + l.Position2 = fyne.NewPos(l.Position1.X+size.Width, l.Position1.Y+size.Height) + Refresh(l) } diff --git a/canvas/line.go b/canvas/line.go index ef4827bccd..66a59f7306 100644 --- a/canvas/line.go +++ b/canvas/line.go @@ -30,6 +30,10 @@ func (l *Line) Size() fyne.Size { // Resize sets a new bottom-right position for the line object and it will then be refreshed. func (l *Line) Resize(size fyne.Size) { + if size == l.Size() { + return + } + l.Position2 = fyne.NewPos(l.Position1.X+size.Width, l.Position1.Y+size.Height) Refresh(l) } diff --git a/canvas/rectangle.go b/canvas/rectangle.go index 6700a488a1..68a8244ff5 100644 --- a/canvas/rectangle.go +++ b/canvas/rectangle.go @@ -26,6 +26,10 @@ func (r *Rectangle) Refresh() { // Resize on a rectangle updates the new size of this object. // If it has a stroke width this will cause it to Refresh. func (r *Rectangle) Resize(s fyne.Size) { + if s == r.Size() { + return + } + r.baseObject.Resize(s) if r.StrokeWidth == 0 { return