mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
Merge pull request #7505 from penpot/elenatorro-review-extrect
🔧 Fix extrect and selrect debug interactivity
This commit is contained in:
commit
a62f1fb46f
@ -808,9 +808,9 @@ impl RenderState {
|
|||||||
|
|
||||||
if self.options.is_debug_visible() {
|
if self.options.is_debug_visible() {
|
||||||
let shape_selrect_bounds = self.get_shape_selrect_bounds(&shape);
|
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, Some(shape_selrect_bounds), None);
|
||||||
debug::render_debug_shape(self, shape_selrect_bounds, shape_extrect_bounds);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if apply_to_current_surface {
|
if apply_to_current_surface {
|
||||||
self.apply_drawing_to_render_canvas(Some(&shape));
|
self.apply_drawing_to_render_canvas(Some(&shape));
|
||||||
}
|
}
|
||||||
@ -1294,6 +1294,12 @@ impl RenderState {
|
|||||||
modifiers,
|
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 {
|
if !is_visible {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -147,8 +147,8 @@ pub fn render_workspace_current_tile(
|
|||||||
|
|
||||||
pub fn render_debug_shape(
|
pub fn render_debug_shape(
|
||||||
render_state: &mut RenderState,
|
render_state: &mut RenderState,
|
||||||
shape_selrect: skia::Rect,
|
shape_selrect: Option<skia::Rect>,
|
||||||
shape_extrect: skia::Rect,
|
shape_extrect: Option<skia::Rect>,
|
||||||
) {
|
) {
|
||||||
let canvas = render_state.surfaces.canvas(SurfaceId::Debug);
|
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_color(skia::Color::RED);
|
||||||
paint.set_stroke_width(1.);
|
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);
|
paint.set_color(skia::Color::BLUE);
|
||||||
canvas.draw_rect(shape_extrect, &paint);
|
canvas.draw_rect(rect, &paint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user