Skip to content

Commit a8e0e9f

Browse files
committed
Removed workaround for #25 and #26 (now they are properly fixed
by avoiding reentrant graphic updates in graphic events callbacks)
1 parent eb490c4 commit a8e0e9f

File tree

3 files changed

+1
-26
lines changed

3 files changed

+1
-26
lines changed

geogram

src/lib/OGF/mesh_gfx/tools/mesh_grob_paint_tools.cpp

-23
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,6 @@ namespace OGF {
10211021
MeshGrobPaintRect::MeshGrobPaintRect(
10221022
ToolsManager* parent
10231023
) : MeshGrobPaintTool(parent) {
1024-
// This active flag is needed, else sometimes when one
1025-
// picks a GUI item, this triggers a release() event
1026-
// and creates a selection.
1027-
active_ = false;
10281024
}
10291025

10301026
void MeshGrobPaintRect::grab(const RayPick& p_ndc) {
@@ -1036,7 +1032,6 @@ namespace OGF {
10361032

10371033
MeshGrobPaintTool::grab(p_ndc);
10381034
p_ = ndc_to_dc(p_ndc.p_ndc);
1039-
active_ = true;
10401035
}
10411036

10421037
void MeshGrobPaintRect::drag(const RayPick& p_ndc) {
@@ -1046,10 +1041,6 @@ namespace OGF {
10461041
return;
10471042
}
10481043

1049-
if(!active_) {
1050-
return;
1051-
}
1052-
10531044
// Draw selection rectangle in overlay
10541045
vec2 q = ndc_to_dc(p_ndc.p_ndc);
10551046
rendering_context()->overlay().clear();
@@ -1085,11 +1076,6 @@ namespace OGF {
10851076
return;
10861077
}
10871078

1088-
if(!active_) {
1089-
return;
1090-
}
1091-
1092-
active_ = false;
10931079
vec2 q = ndc_to_dc(raypick.p_ndc);
10941080
index_t px = index_t(p_.x);
10951081
index_t py = index_t(p_.y);
@@ -1284,7 +1270,6 @@ namespace OGF {
12841270

12851271
MeshGrobPaintTool::grab(raypick);
12861272
selection_.push_back(ndc_to_dc(raypick.p_ndc));
1287-
active_ = true;
12881273
}
12891274

12901275
void MeshGrobPaintFreeform::drag(const RayPick& raypick) {
@@ -1294,9 +1279,6 @@ namespace OGF {
12941279
return;
12951280
}
12961281

1297-
if(!active_) {
1298-
return;
1299-
}
13001282
if(length(raypick.p_ndc - latest_ndc_) <= 10.0/1024.0) {
13011283
return ;
13021284
}
@@ -1318,11 +1300,6 @@ namespace OGF {
13181300
return;
13191301
}
13201302

1321-
if(!active_) {
1322-
return;
1323-
}
1324-
active_ = false;
1325-
13261303
index_t x0,y0,width,height;
13271304
{
13281305
double minx = Numeric::max_float64();

src/lib/OGF/mesh_gfx/tools/mesh_grob_paint_tools.h

-2
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,6 @@ namespace OGF {
294294
index_t x0, index_t y0, index_t x1, index_t y1,
295295
Image* mask = nullptr
296296
);
297-
298-
bool active_;
299297
vec2 p_;
300298
};
301299

0 commit comments

Comments
 (0)