mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-25 17:58:11 +08:00
Make the toggle overlays button functional (#484)
* Make the toggle overlays button functional * Move state from the OverlaysMessageHandler to DocumentMessageHandler * Code review fixes
This commit is contained in:
@@ -415,12 +415,18 @@ impl JsEditorHandle {
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
/// Set snapping disabled / enabled
|
||||
/// Set snapping on or off
|
||||
pub fn set_snapping(&self, snap: bool) {
|
||||
let message = DocumentMessage::SetSnapping { snap };
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
/// Set display of overlays on or off
|
||||
pub fn set_overlays_visibility(&self, visible: bool) {
|
||||
let message = DocumentMessage::SetOverlaysVisibility { visible };
|
||||
self.dispatch(message);
|
||||
}
|
||||
|
||||
/// Set the view mode to change the way layers are drawn in the viewport
|
||||
pub fn set_view_mode(&self, view_mode: String) -> Result<(), JsValue> {
|
||||
if let Some(view_mode) = translate_view_mode(view_mode.as_str()) {
|
||||
|
||||
Reference in New Issue
Block a user