mirror of
https://github.com/spacedeck/spacedeck-open.git
synced 2025-12-16 01:47:30 +01:00
touch: fix vector transforming (points of arrows, scribbles)
This commit is contained in:
@@ -1019,8 +1019,7 @@ var SpacedeckSections = {
|
||||
};
|
||||
},
|
||||
|
||||
update_selection_metrics: function(arts) {
|
||||
|
||||
update_selection_metrics: function(arts, temporary) {
|
||||
if (this.active_tool == "scribble") {
|
||||
this.selection_metrics.count = 1;
|
||||
return;
|
||||
@@ -1053,8 +1052,6 @@ var SpacedeckSections = {
|
||||
// FIXME make sure that menus fit in window
|
||||
this.toolbar_props_x = pp.x+"px";
|
||||
this.toolbar_props_y = pp.y+"px";
|
||||
|
||||
//this.hide_toolbar_artifacts();
|
||||
}
|
||||
|
||||
this.selection_metrics.x1 = sr.x1;
|
||||
@@ -1069,24 +1066,26 @@ var SpacedeckSections = {
|
||||
|
||||
if (!arts) arts = this.selected_artifacts();
|
||||
|
||||
this.first_selected_artifact = arts[0];
|
||||
this.selection_metrics.count=arts.length;
|
||||
this.selection_metrics.scribble_selection = false;
|
||||
if (arts.length == 1 && arts[0].mime == "x-spacedeck/vector") {
|
||||
if (arts[0].shape == "scribble") {
|
||||
this.selection_metrics.scribble_selection = true;
|
||||
if (!temporary) {
|
||||
this.first_selected_artifact = arts[0];
|
||||
this.selection_metrics.count=arts.length;
|
||||
this.selection_metrics.scribble_selection = false;
|
||||
if (arts.length == 1 && arts[0].mime == "x-spacedeck/vector") {
|
||||
if (arts[0].shape == "scribble") {
|
||||
this.selection_metrics.scribble_selection = true;
|
||||
}
|
||||
this.selection_metrics.vector_points = arts[0].control_points;
|
||||
this.selection_metrics.vector_selection = true;
|
||||
} else {
|
||||
this.selection_metrics.vector_points = [{},{}];
|
||||
this.selection_metrics.vector_selection = false;
|
||||
}
|
||||
this.selection_metrics.has_link=false;
|
||||
this.insert_link_url="";
|
||||
if (arts.length == 1 && arts[0].meta && arts[0].meta.link_uri && arts[0].meta.link_uri.length>0) {
|
||||
this.selection_metrics.has_link=true;
|
||||
this.insert_link_url = arts[0].meta.link_uri;
|
||||
}
|
||||
this.selection_metrics.vector_points = arts[0].control_points;
|
||||
this.selection_metrics.vector_selection = true;
|
||||
} else {
|
||||
this.selection_metrics.vector_points = [{},{}];
|
||||
this.selection_metrics.vector_selection = false;
|
||||
}
|
||||
this.selection_metrics.has_link=false;
|
||||
this.insert_link_url="";
|
||||
if (arts.length == 1 && arts[0].meta && arts[0].meta.link_uri && arts[0].meta.link_uri.length>0) {
|
||||
this.selection_metrics.has_link=true;
|
||||
this.insert_link_url = arts[0].meta.link_uri;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1436,13 +1435,13 @@ var SpacedeckSections = {
|
||||
this.color_picker_rgb = rgb_to_hex(rgba.r,rgba.g,rgba.b);
|
||||
},
|
||||
|
||||
update_selected_artifacts: function(change_func, override_locked) {
|
||||
update_selected_artifacts: function(change_func, override_locked, temporary) {
|
||||
var artifacts = this.selected_artifacts(!override_locked);
|
||||
|
||||
if (!artifacts.length) return;
|
||||
|
||||
this.update_artifacts(artifacts, change_func);
|
||||
this.update_selection_metrics();
|
||||
this.update_selection_metrics(null, temporary||false);
|
||||
},
|
||||
|
||||
nudge_selected_artifacts: function(dx, dy, event) {
|
||||
|
||||
Reference in New Issue
Block a user