mirror of
https://github.com/penpot/penpot.git
synced 2025-07-13 15:47:16 +02:00
🎉 Hidden layer support for wasm render
This commit is contained in:
parent
7c7ede9d0c
commit
07215357d6
5 changed files with 20 additions and 3 deletions
|
@ -263,6 +263,14 @@ pub extern "C" fn set_shape_opacity(opacity: f32) {
|
|||
}
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn set_shape_hidden(hidden: bool) {
|
||||
let state = unsafe { STATE.as_mut() }.expect("got an invalid state pointer");
|
||||
if let Some(shape) = state.current_shape() {
|
||||
shape.hidden = hidden;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
init_gl();
|
||||
}
|
||||
|
|
|
@ -389,7 +389,7 @@ impl RenderState {
|
|||
let mut is_complete = self.viewbox.area.contains(shape.selrect);
|
||||
|
||||
if !id.is_nil() {
|
||||
if !shape.selrect.intersects(self.viewbox.area) {
|
||||
if !shape.selrect.intersects(self.viewbox.area) || shape.hidden {
|
||||
self.render_debug_shape(shape, false);
|
||||
// TODO: This means that not all the shapes are renderer so we
|
||||
// need to call a render_all on the zoom out.
|
||||
|
|
|
@ -51,6 +51,7 @@ pub struct Shape {
|
|||
fills: Vec<Fill>,
|
||||
pub blend_mode: BlendMode,
|
||||
pub opacity: f32,
|
||||
pub hidden: bool,
|
||||
}
|
||||
|
||||
impl Shape {
|
||||
|
@ -65,6 +66,7 @@ impl Shape {
|
|||
fills: vec![],
|
||||
blend_mode: BlendMode::default(),
|
||||
opacity: 1.,
|
||||
hidden: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue