mirror of
https://github.com/penpot/penpot.git
synced 2025-06-13 16:31:39 +02:00
♻️ Refactor into render submodules
This commit is contained in:
parent
647635a819
commit
001aa3f319
3 changed files with 76 additions and 69 deletions
26
render-wasm/src/render/options.rs
Normal file
26
render-wasm/src/render/options.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
use crate::debug;
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub struct RenderOptions {
|
||||
pub debug_flags: u32,
|
||||
pub dpr: Option<f32>,
|
||||
}
|
||||
|
||||
impl Default for RenderOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
debug_flags: 0x00,
|
||||
dpr: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl RenderOptions {
|
||||
pub fn is_debug_visible(&self) -> bool {
|
||||
self.debug_flags & debug::DEBUG_VISIBLE == debug::DEBUG_VISIBLE
|
||||
}
|
||||
|
||||
pub fn dpr(&self) -> f32 {
|
||||
self.dpr.unwrap_or(1.0)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue