mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Merge pull request #7505 from penpot/elenatorro-review-extrect
Some checks failed
_DEVELOP / build-bundle (push) Has been cancelled
_DEVELOP / build-docker (push) Has been cancelled
_STAGING / build-bundle (push) Has been cancelled
_STAGING / build-docker (push) Has been cancelled
Commit Message Check / Check Commit Message (push) Has been cancelled
Some checks failed
_DEVELOP / build-bundle (push) Has been cancelled
_DEVELOP / build-docker (push) Has been cancelled
_STAGING / build-bundle (push) Has been cancelled
_STAGING / build-docker (push) Has been cancelled
Commit Message Check / Check Commit Message (push) Has been cancelled
🔧 Fix extrect and selrect debug interactivity
This commit is contained in:
@@ -808,9 +808,9 @@ impl RenderState {
|
||||
|
||||
if self.options.is_debug_visible() {
|
||||
let shape_selrect_bounds = self.get_shape_selrect_bounds(&shape);
|
||||
let shape_extrect_bounds = self.get_shape_extrect_bounds(&shape, shapes, modifiers);
|
||||
debug::render_debug_shape(self, shape_selrect_bounds, shape_extrect_bounds);
|
||||
debug::render_debug_shape(self, Some(shape_selrect_bounds), None);
|
||||
}
|
||||
|
||||
if apply_to_current_surface {
|
||||
self.apply_drawing_to_render_canvas(Some(&shape));
|
||||
}
|
||||
@@ -1294,6 +1294,12 @@ impl RenderState {
|
||||
modifiers,
|
||||
);
|
||||
|
||||
if self.options.is_debug_visible() {
|
||||
let shape_extrect_bounds =
|
||||
self.get_shape_extrect_bounds(&transformed_element, tree, modifiers);
|
||||
debug::render_debug_shape(self, None, Some(shape_extrect_bounds));
|
||||
}
|
||||
|
||||
if !is_visible {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -147,8 +147,8 @@ pub fn render_workspace_current_tile(
|
||||
|
||||
pub fn render_debug_shape(
|
||||
render_state: &mut RenderState,
|
||||
shape_selrect: skia::Rect,
|
||||
shape_extrect: skia::Rect,
|
||||
shape_selrect: Option<skia::Rect>,
|
||||
shape_extrect: Option<skia::Rect>,
|
||||
) {
|
||||
let canvas = render_state.surfaces.canvas(SurfaceId::Debug);
|
||||
|
||||
@@ -157,11 +157,13 @@ pub fn render_debug_shape(
|
||||
paint.set_color(skia::Color::RED);
|
||||
paint.set_stroke_width(1.);
|
||||
|
||||
canvas.draw_rect(shape_selrect, &paint);
|
||||
if let Some(rect) = shape_selrect {
|
||||
canvas.draw_rect(rect, &paint);
|
||||
}
|
||||
|
||||
if shape_extrect != shape_selrect {
|
||||
if let Some(rect) = shape_extrect {
|
||||
paint.set_color(skia::Color::BLUE);
|
||||
canvas.draw_rect(shape_extrect, &paint);
|
||||
canvas.draw_rect(rect, &paint);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user