mirror of
https://github.com/penpot/penpot.git
synced 2026-03-22 18:33:45 +00:00
✨ Show/hide wasm info label via config flag
This commit is contained in:
@@ -136,6 +136,8 @@
|
||||
:webhooks
|
||||
;; TODO: deprecate this flag and consolidate the code
|
||||
:render-wasm-dpr
|
||||
;; Show WASM renderer info label (hidden by default).
|
||||
:render-wasm-info
|
||||
:hide-release-modal
|
||||
:subscriptions
|
||||
:subscriptions-old
|
||||
|
||||
@@ -1401,7 +1401,9 @@
|
||||
(dbg/enabled? :wasm-viewbox)
|
||||
(bit-or 2r00000000000000000000000000000001)
|
||||
(text-editor-wasm?)
|
||||
(bit-or 2r00000000000000000000000000001000)))
|
||||
(bit-or 2r00000000000000000000000000001000)
|
||||
(contains? cf/flags :render-wasm-info)
|
||||
(bit-or 2r00000000000000000000000000010000)))
|
||||
|
||||
(defn set-canvas-size
|
||||
[canvas]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
pub const DEBUG_VISIBLE: u32 = 0x01;
|
||||
pub const PROFILE_REBUILD_TILES: u32 = 0x02;
|
||||
pub const FAST_MODE: u32 = 0x04;
|
||||
pub const INFO_TEXT: u32 = 0x08;
|
||||
pub const TEXT_EDITOR_V3: u32 = 0x08;
|
||||
pub const SHOW_WASM_INFO: u32 = 0x10;
|
||||
|
||||
@@ -41,6 +41,10 @@ pub fn render_debug_cache_surface(render_state: &mut RenderState) {
|
||||
}
|
||||
|
||||
pub fn render_wasm_label(render_state: &mut RenderState) {
|
||||
if !render_state.options.show_wasm_info() {
|
||||
return;
|
||||
}
|
||||
|
||||
let canvas = render_state.surfaces.canvas(SurfaceId::Target);
|
||||
let skia::ISize { width, height } = canvas.base_layer_size();
|
||||
let mut paint = skia::Paint::default();
|
||||
|
||||
@@ -33,6 +33,10 @@ impl RenderOptions {
|
||||
}
|
||||
|
||||
pub fn show_info_text(&self) -> bool {
|
||||
self.flags & options::INFO_TEXT == options::INFO_TEXT
|
||||
self.flags & options::TEXT_EDITOR_V3 == options::TEXT_EDITOR_V3
|
||||
}
|
||||
|
||||
pub fn show_wasm_info(&self) -> bool {
|
||||
self.flags & options::SHOW_WASM_INFO == options::SHOW_WASM_INFO
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user