diff options
Diffstat (limited to 'src/gui/PatchPortModule.cpp')
-rw-r--r-- | src/gui/PatchPortModule.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gui/PatchPortModule.cpp b/src/gui/PatchPortModule.cpp index 4c2b321b..15c26392 100644 --- a/src/gui/PatchPortModule.cpp +++ b/src/gui/PatchPortModule.cpp @@ -80,20 +80,24 @@ PatchPortModule::show_menu(GdkEventButton* ev) void PatchPortModule::store_location() { - const float x = static_cast<float>(property_x()); - const float y = static_cast<float>(property_y()); + const Atom x(static_cast<float>(property_x())); + const Atom y(static_cast<float>(property_y())); const LV2URIMap& uris = App::instance().uris(); const Atom& existing_x = _model->get_property(uris.ingenui_canvas_x); const Atom& existing_y = _model->get_property(uris.ingenui_canvas_y); - if (existing_x.type() != Atom::FLOAT || existing_y.type() != Atom::FLOAT - || existing_x.get_float() != x || existing_y.get_float() != y) { - Resource::Properties props; - props.insert(make_pair(uris.ingenui_canvas_x, Atom(x))); - props.insert(make_pair(uris.ingenui_canvas_y, Atom(y))); - App::instance().engine()->put(_model->path(), props, Resource::INTERNAL); + if (x != existing_x && y != existing_y) { + Resource::Properties remove; + remove.insert(make_pair(uris.ingenui_canvas_x, uris.wildcard)); + remove.insert(make_pair(uris.ingenui_canvas_y, uris.wildcard)); + Resource::Properties add; + add.insert(make_pair(uris.ingenui_canvas_x, + Resource::Property(x, Resource::INTERNAL))); + add.insert(make_pair(uris.ingenui_canvas_y, + Resource::Property(y, Resource::INTERNAL))); + App::instance().engine()->delta(_model->path(), remove, add); } } |