Some minor fixes. #3603

This commit is contained in:
Alessandro Ranellucci 2016-12-21 20:42:17 +01:00
parent 49a9492ad2
commit 475f9d45a5
3 changed files with 6 additions and 3 deletions

View File

@ -304,7 +304,7 @@ sub mouse_event {
$self->_dragged(undef);
} elsif ($e->Moving) {
$self->_mouse_pos($pos);
$self->Refresh;
$self->Refresh if $self->enable_picking;
} else {
$e->Skip();
}
@ -976,6 +976,9 @@ sub Render {
glFlush();
$self->SwapBuffers();
# Calling glFinish has a performance penalty, but it seems to fix some OpenGL driver hang-up with extremely large scenes.
glFinish();
}
sub draw_axes {

View File

@ -41,7 +41,7 @@ FillRectilinear::_fill_single_direction(ExPolygon expolygon,
// extend bounding box so that our pattern will be aligned with other layers
// Transform the reference point to the rotated coordinate system.
Point p = direction.second.rotated(-direction.first);
p.x -= x_shift > 0 ? x_shift : (x_shift + line_spacing);
p.x -= x_shift >= 0 ? x_shift : (x_shift + line_spacing);
bounding_box.min.align_to_grid(
Point(line_spacing, line_spacing),
p

View File

@ -94,7 +94,7 @@ parallelize(std::queue<T> queue, boost::function<void(T)> func,
if (threads_count == 0) threads_count = 2;
boost::mutex queue_mutex;
boost::thread_group workers;
for (int i = 0; i < fminf(threads_count, queue.size()); i++)
for (int i = 0; i < std::min(threads_count, (int)queue.size()); i++)
workers.add_thread(new boost::thread(&_parallelize_do<T>, &queue, &queue_mutex, func));
workers.join_all();
}