Commit de23ce80 authored by Jonathan Wilkes's avatar Jonathan Wilkes

fix #306: OSX: Zoomed-in behaviour while using cursor keys to move an

object - the whole screen moves. This fix allows cursor keys in runmode
while disabling them in editmode.
parent 5c498e8a
......@@ -304,6 +304,12 @@ var canvas_events = (function() {
},
keydown: function(evt) {
pdgui.keydown(name, evt);
// prevent the default behavior of scrolling
// on arrow keys in editmode
if (document.querySelector("#patchsvg")
.classList.contains("editmode")) {
evt.preventDefault();
}
},
keypress: function(evt) {
pdgui.keypress(name, evt);
......@@ -926,7 +932,7 @@ function register_window_id(cid, attr_array) {
// Initialize the zoom level to the value retrieved from the patch, if any.
nw.Window.get().zoomLevel = attr_array.zoom;
pdgui.canvas_map(cid); // side-effect: triggers gui_canvas_get_scroll
pdgui.canvas_set_editmode(cid, attr_array.editmod);
pdgui.canvas_set_editmode(cid, attr_array.editmode);
// For now, there is no way for the cord inspector to be turned on by
// default. But if this changes we need to set its menu item checkbox
// accordingly here
......
......@@ -4909,6 +4909,8 @@ function gui_textarea(cid, tag, type, x, y, width_spec, height_spec, text,
var range, svg_view, p,
gobj = get_gobj(cid, tag);
if (state !== 0) {
// Make sure we're in editmode
canvas_set_editmode(cid, 1);
// Hide the gobj while we edit. However, we want the gobj to
// contribute to the svg's bbox-- that way when the new_object_textentry
// goes away we still have the same dimensions. Otherwise the user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment