void DrawRectangleTool::updateDirtyRect() { QRectF rect; includePreviewRects(rect); if (shift_pressed) snap_helper->includeDirtyRect(rect); if (is_helper_tool) emit(dirtyRectChanged(rect)); else { if (angle_helper->isActive()) angle_helper->includeDirtyRect(rect); if (rect.isValid()) { float helper_cross_radius = Settings::getInstance().getRectangleToolHelperCrossRadiusPx(); int pixel_border = 0; if (editingInProgress()) pixel_border = helper_cross_radius; // helper_cross_radius as border is less than ideal but the only way to always ensure visibility of the helper cross at the moment if (angle_helper->isActive()) pixel_border = qMax(pixel_border, angle_helper->getDisplayRadius()); map()->setDrawingBoundingBox(rect, pixel_border, true); } else map()->clearDrawingBoundingBox(); } }
void DrawPathTool::updateDirtyRect() { QRectF rect; if (dragging) { rectIncludeSafe(rect, click_pos_map); rectInclude(rect, cur_pos_map); } if (editingInProgress() && previous_point_is_curve_point) { rectIncludeSafe(rect, previous_pos_map); rectInclude(rect, previous_drag_map); } if ((editingInProgress() && !dragging) || (!editingInProgress() && !shift_pressed && ctrl_pressed) || (!editingInProgress() && (picking_angle || picked_angle))) { angle_helper->includeDirtyRect(rect); } if (shift_pressed || (!editingInProgress() && ctrl_pressed)) snap_helper->includeDirtyRect(rect); includePreviewRects(rect); if (is_helper_tool) emit(dirtyRectChanged(rect)); else { if (rect.isValid()) map()->setDrawingBoundingBox(rect, qMax(qMax(dragging ? 1 : 0, angle_helper->getDisplayRadius()), snap_helper->getDisplayRadius()), true); else map()->clearDrawingBoundingBox(); } }
void DrawCircleTool::setDirtyRect() { QRectF rect; includePreviewRects(rect); if (is_helper_tool) emit(dirtyRectChanged(rect)); else { if (rect.isValid()) map()->setDrawingBoundingBox(rect, 0, true); else map()->clearDrawingBoundingBox(); } }