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:
Keavon Chambers 2022-01-16 09:40:47 -08:00
parent 10205ef599
commit 94ecbf7112
7 changed files with 35 additions and 17 deletions

View file

@ -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()) {