mirror of
https://github.com/penpot/penpot.git
synced 2025-06-05 08:21:39 +02:00
♻️ Refactor how rebuild_tiles works
This commit is contained in:
parent
fef342b489
commit
caf13eb774
8 changed files with 63 additions and 15 deletions
|
@ -1,15 +1,15 @@
|
|||
use crate::debug;
|
||||
use crate::options;
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
pub struct RenderOptions {
|
||||
pub debug_flags: u32,
|
||||
pub flags: u32,
|
||||
pub dpr: Option<f32>,
|
||||
}
|
||||
|
||||
impl Default for RenderOptions {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
debug_flags: 0x00,
|
||||
flags: 0x00,
|
||||
dpr: None,
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,11 @@ impl Default for RenderOptions {
|
|||
|
||||
impl RenderOptions {
|
||||
pub fn is_debug_visible(&self) -> bool {
|
||||
self.debug_flags & debug::DEBUG_VISIBLE == debug::DEBUG_VISIBLE
|
||||
self.flags & options::DEBUG_VISIBLE == options::DEBUG_VISIBLE
|
||||
}
|
||||
|
||||
pub fn is_profile_rebuild_tiles(&self) -> bool {
|
||||
self.flags & options::PROFILE_REBUILD_TILES == options::PROFILE_REBUILD_TILES
|
||||
}
|
||||
|
||||
pub fn dpr(&self) -> f32 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue