Draw rectangle several times and undo and crash appears

Bug #1996522 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Confirmed
Undecided
Unassigned

Bug Description

I tested Pinta latest commit from feature/shape-tool-handles branch on Ubuntu 22.10. I intended to test the bug 1958924, but I can also reproduce bellow problems on master branch, so I decided to open an independent bug report.

1. Rectangle from tools and draw rectangle on canvas.
2. Draw another rectangle to the right of the first one.
3. Draw third rectangle to the right of the second one.
4. Rectangle Select and select some area on canvas.
5. Undo - it undoes the selection.
6. Undo - problem appears. It undoes first two rectangles and the third one remains (I expect the opposite that third one would disappear and first two still visible).
7. Unto - now second one is magically displayed, but third one is not anymore (like I expect), but first one is still hidden.
8. Undo - now first rectangle is displayed and second and third are not. As far as I see this is OK.
9. Undo - all of the rectangles disappear. It looks fine.
10. Change focus to some other program.
11. Change back to Pinta and click outside of the canvas and crash appears:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at Pinta.Tools.BaseEditEngine.HandleMouseDown(Document document, ToolMouseEventArgs e)
   at Pinta.Tools.ShapeTool.OnMouseDown(Document document, ToolMouseEventArgs e)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
   at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)

Tags: line-tool
Revision history for this message
Cameron White (cameronwhite91) wrote :

I haven't been able to reproduce the crash, but I can reproduce the other issue with shapes not appearing
If you manage to hover over the right place the control points are still there, just the shape hasn't been redrawn properly after undoing

Changed in pinta:
status: New → Confirmed
tags: added: line-tool
Revision history for this message
grofaty (grofaty) wrote :

I now tried several times, but I also can't reproduce the crash. I must have performed some additional action, that I can't remember. I know I was switching between Pinta and text editor with ALT+TAB because I was testing and making notes about step-by-step. Maybe this somehow triggers the crash.

If I manage to trigger the crash again and have step-by-step instructions I will post them here. But maybe we should focus on incorrect behavior of undo.

Don't understand me in wrong way, I don't want to be too much critical, but using Pinta for more than decade and I think that Undo is something that I have been afraid of doing, because a lot of time has been broken and I never know what to get into when I perform Undo. If I wish one thing, that would really be working fine in Pinta is Undo.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.