mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 01:18:13 +08:00
Fix panel docking bugs and polish its behavior (#4087)
* Fix panel docking bugs and polish its behavior * Fix bug
This commit is contained in:
@@ -29,6 +29,12 @@ impl MessageHandler<OverlaysMessage, OverlaysMessageContext<'_>> for OverlaysMes
|
||||
use crate::messages::viewport::{Position, ToPhysical};
|
||||
use wasm_bindgen::JsCast;
|
||||
|
||||
// Discard detached canvas after a panel reorganization remounts the DOM
|
||||
if self.canvas.as_ref().is_some_and(|canvas| !canvas.is_connected()) {
|
||||
self.canvas = None;
|
||||
self.context = None;
|
||||
}
|
||||
|
||||
let canvas = match &self.canvas {
|
||||
Some(canvas) => canvas,
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user