Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't grab the 38th Selective Editing spot #7148

Open
Benitoite opened this issue Jul 22, 2024 · 7 comments · May be fixed by #7178
Open

Can't grab the 38th Selective Editing spot #7148

Benitoite opened this issue Jul 22, 2024 · 7 comments · May be fixed by #7178
Labels
scope: GUI Changes to GUI, not core functionality type: bug Something is not doing what it's supposed to be doing
Milestone

Comments

@Benitoite
Copy link
Contributor

Benitoite commented Jul 22, 2024

@Desmis et al., in re: Selective Editing problem.

Background

  1. Unknown if there is a programmatic limitation on # of usable selective editing spots.
  2. I am trying to create many spots to create a QR code watermark.
  3. Files: selective-issue.zip

Description:

  • I have created 37 spots. Creating any more new or duplicate spots works but I am not able to grab the new spots no matter where they are.

Reproduce the bug:

  1. Open attached png & pp3.
  2. Generate an additional new or duplicate spot.
  3. Try to grab the spot to move it or resize it.
  4. The new spot is not visible to the mouse.

Expected outcome:

  • I would expect to be able to generate more spots to complete the QR code.

Version in use:

RawTherapee current dev / macOS 12.7.5 Monterey

Screen Shot 2024-07-22 at 11 09 16 AM

Progress so far on the QR thingy:
Screen Shot 2024-07-22 at 11 20 56 AM

@Desmis
Copy link
Collaborator

Desmis commented Jul 23, 2024

@Benitoite
Normally there are no limits, but I've never tried.
I confirm the malfunction and will have a look, but I don't know why? Could be a GTK or handles problem, or something else. This is not my area of ​​expertise.

Jacques

@Lawrence37 Lawrence37 added type: bug Something is not doing what it's supposed to be doing scope: GUI Changes to GUI, not core functionality labels Jul 25, 2024
@Pandagrapher
Copy link
Collaborator

@Benitoite
By default, edit widgets are limited to 256 objects (one spot = 7 edit widget objects). This limit is so reached with a 37th spot. There is a second implemented mode to manage up to 65535 objects (with performance losses). However, I think there is a bug in code and so this mode is never activated. Can you please try with this patch?

index ddb38f16a..04ef06995 100644
--- a/rtgui/cropwindow.cc
+++ b/rtgui/cropwindow.cc
@@ -1961,7 +1961,7 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
                 // drawing to the "mouse over" channel
                 const auto mouseOverGeom = editSubscriber->getMouseOverGeometry();
                 if (mouseOverGeom.size()) {
-                    if (mouseOverGeom.size() > 65534) {
+                    if (mouseOverGeom.size() > 255) {
                         // once it has been switched to OM_65535, it won't return back to OM_255
                         // to avoid constant memory allocations in some particular situation.
                         // It will return to OM_255 on a new editing session

Pierre

@Benitoite
Copy link
Contributor Author

Benitoite commented Aug 9, 2024

Thank you, @Pandagrapher . With this patch I get an immediate crash of the main thread upon clicking the Selective Editing tab.

From the macOS system crash reporter:
Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	    0x7ff80cacbfce __pthread_kill + 10
1   libsystem_pthread.dylib       	    0x7ff80cb021ff pthread_kill + 263
2   libsystem_c.dylib             	    0x7ff80ca4dd14 abort + 123
3   libsystem_c.dylib             	    0x7ff80ca4d0bb __assert_rtn + 314
4   libcairo.2.dylib              	       0x103c98313 cairo_surface_destroy.cold.1 + 35
5   libcairo.2.dylib              	       0x103c2a683 cairo_surface_destroy + 233
6   libcairomm-1.0.1.dylib        	       0x1028ddd28 Cairo::Surface::~Surface() + 28
7   libcairomm-1.0.1.dylib        	       0x1028de46e Cairo::ImageSurface::~ImageSurface() + 14
8   rawtherapee                   	       0x10166d961 CropWindow::expose(Cairo::RefPtr<Cairo::Context>) + 11153
9   rawtherapee                   	       0x10177d8f4 ImageArea::on_draw(Cairo::RefPtr<Cairo::Context> const&) + 84
10  libgtkmm-3.0.1.dylib          	       0x103782ee5 Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 167
11  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
12  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
13  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
14  libgtk-3.0.dylib              	       0x1042aa3fd gtk_frame_render + 311
15  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
16  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
17  libgtk-3.0.dylib              	       0x1042a9d9d gtk_frame_draw + 17
18  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
19  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
20  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
21  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
22  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
23  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
24  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
25  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
26  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
27  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
28  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
29  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
30  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
31  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
32  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
33  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
34  libgtkmm-3.0.1.dylib          	       0x103788c81 Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) + 71
35  libgtkmm-3.0.1.dylib          	       0x103782ee5 Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 167
36  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
37  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
38  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
39  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
40  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
41  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
42  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
43  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
44  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
45  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
46  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
47  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
48  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
49  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
50  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
51  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
52  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
53  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
54  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
55  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
56  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
57  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
58  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
59  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
60  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
61  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
62  libgtk-3.0.dylib              	       0x10431d12d gtk_paned_render + 471
63  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
64  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
65  libgtk-3.0.dylib              	       0x10431b2a2 gtk_paned_draw + 17
66  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
67  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
68  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
69  libgtk-3.0.dylib              	       0x10431d12d gtk_paned_render + 471
70  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
71  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
72  libgtk-3.0.dylib              	       0x10431b2a2 gtk_paned_draw + 17
73  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
74  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
75  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
76  libgtk-3.0.dylib              	       0x10431d074 gtk_paned_render + 286
77  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
78  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
79  libgtk-3.0.dylib              	       0x10431b2a2 gtk_paned_draw + 17
80  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
81  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
82  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
83  libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
84  libgtk-3.0.dylib              	       0x1041ebe9d gtk_box_draw_contents + 37
85  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
86  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
87  libgtk-3.0.dylib              	       0x1041eb2f3 gtk_box_draw + 17
88  libgtkmm-3.0.1.dylib          	       0x103788c81 Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) + 71
89  libgtkmm-3.0.1.dylib          	       0x103782ee5 Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 167
90  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
91  libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
92  libgtk-3.0.dylib              	       0x10431453e gtk_notebook_draw_stack + 64
93  libgtk-3.0.dylib              	       0x104234e56 gtk_css_custom_gadget_draw + 37
94  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
95  libgtk-3.0.dylib              	       0x1041ee036 gtk_box_gadget_draw + 178
96  libgtk-3.0.dylib              	       0x104239186 gtk_css_gadget_draw + 646
97  libgtk-3.0.dylib              	       0x104310368 gtk_notebook_draw + 46
98  libgtkmm-3.0.1.dylib          	       0x103782f9e Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 352
99  libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
100 libgtk-3.0.dylib              	       0x10422e023 gtk_container_propagate_draw + 417
101 libgtk-3.0.dylib              	       0x10422e5ad gtk_container_draw + 120
102 libgtk-3.0.dylib              	       0x10442618c gtk_window_draw + 750
103 libgtkmm-3.0.1.dylib          	       0x103788c81 Gtk::Widget::on_draw(Cairo::RefPtr<Cairo::Context> const&) + 71
104 libgtkmm-3.0.1.dylib          	       0x103782ee5 Gtk::Widget_Class::draw_callback(_GtkWidget*, _cairo*) + 167
105 libgtk-3.0.dylib              	       0x10440b3d6 gtk_widget_draw_internal + 337
106 libgtk-3.0.dylib              	       0x10440c15a gtk_widget_render + 176
107 libgtk-3.0.dylib              	       0x1042ed776 gtk_main_do_event + 1637
108 libgdk-3.0.dylib              	       0x1032eb68d _gdk_event_emit + 49
109 libgdk-3.0.dylib              	       0x1032f98c4 _gdk_window_process_updates_recurse_helper + 310
110 libgdk-3.0.dylib              	       0x1033066ac -[GdkQuartzView updateLayer] + 205
111 AppKit                        	    0x7ff80f60d4d9 _NSViewUpdateLayer + 98
112 AppKit                        	    0x7ff80f529b5b +[NSAppearance _performWithCurrentAppearance:usingBlock:] + 66
113 AppKit                        	    0x7ff80f768f92 __30-[_NSViewBackingLayer display]_block_invoke + 113
114 AppKit                        	    0x7ff80f565e95 -[NSFocusStack performWithFocusView:inWindow:usingBlock:] + 92
115 AppKit                        	    0x7ff80f60cea2 -[_NSViewBackingLayer display] + 383
116 QuartzCore                    	    0x7ff81410962b CA::Layer::display_if_needed(CA::Transaction*) + 873
117 QuartzCore                    	    0x7ff814260f86 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 640
118 QuartzCore                    	    0x7ff8140eaa89 CA::Transaction::commit() + 777
119 AppKit                        	    0x7ff80f6a8d71 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 285
120 AppKit                        	    0x7ff80fdf0d3c ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
121 CoreFoundation                	    0x7ff80cbc8605 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
122 CoreFoundation                	    0x7ff80cbc849a __CFRunLoopDoObservers + 543
123 CoreFoundation                	    0x7ff80cbc791c __CFRunLoopRun + 840
124 CoreFoundation                	    0x7ff80cbc6f14 CFRunLoopRunSpecific + 562
125 HIToolbox                     	    0x7ff815ce75e6 RunCurrentEventLoopInMode + 292
126 HIToolbox                     	    0x7ff815ce7213 ReceiveNextEventCommon + 283
127 HIToolbox                     	    0x7ff815ce70e5 _BlockUntilNextEventMatchingListInModeWithFilter + 70
128 AppKit                        	    0x7ff80f53caa9 _DPSNextEvent + 927
129 AppKit                        	    0x7ff80f53b166 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1394
130 libgdk-3.0.dylib              	       0x10330e383 poll_func + 179
131 libglib-2.0.0.dylib           	       0x1031e9119 g_main_context_iterate_unlocked + 315
132 libglib-2.0.0.dylib           	       0x1031e937c g_main_loop_run + 104
133 libgtk-3.0.dylib              	       0x1042ecfdd gtk_main + 74
134 libgtkmm-3.0.1.dylib          	       0x1037234ef Gtk::Main::run(Gtk::Window&) + 143
135 rawtherapee                   	       0x1018b47c6 main + 3894
136 dyld                          	       0x1030ff52e start + 462

@Pandagrapher
Copy link
Collaborator

@Benitoite
Just submitted a Pull Request to fix your issue. Now the spot number limitation is at about 9362 spots: should be more than enough ;)

Pierre

@Benitoite
Copy link
Contributor Author

@Pandagrapher This seems better as the new spots are definitely taking effect, and I can make adjustments to the drag handles-- however the adjustments to the handles are taking effect on the wrong spots.

out.mov

In the video I'm trying to move the 38th spot around, but the movements are happening to the first two spots.

@Pandagrapher
Copy link
Collaborator

@Benitoite
Thanks for your tests
I have tested the PR branch with your png file + pp3: I am able to correctly select a spot number greater than 37. The behavior you described is the one I observed before starting working on the patch. Have you used the Pandagrapher:patch_editwidgets branch for your tests?

Pierre

@Benitoite
Copy link
Contributor Author

Have you used the Pandagrapher:patch_editwidgets branch for your tests?

No I was testing by applying the .patch from the PR, but using the build of Pandagrapher:patch_editwidgets as you suggested, it is working fine! Thanks.

@Lawrence37 Lawrence37 linked a pull request Sep 17, 2024 that will close this issue
@Lawrence37 Lawrence37 added this to the v5.12 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: GUI Changes to GUI, not core functionality type: bug Something is not doing what it's supposed to be doing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants