commit
8f6ec34d2f
|
@ -461,8 +461,8 @@ a("#svg_docprops").show()}},s=function(){if(!Ka){Ka=true;var q=a("#bg_blocks div
|
|||
a("#svg_prefs").show()}},A=function(){var q=a("#svg_source_container").height()-50;a("#svg_source_textarea").css("height",q)},F=function(){if(Ia){var q=function(){f.clearSelection();wa();h();Eb();C();la.fill.prep();la.stroke.prep()};f.setSvgString(a("#svg_source_textarea").val())?q():a.confirm(e.notification.QerrorsRevertToSource,function(B){if(!B)return false;q()});ma()}},C=function(q){q=q||f.getDocumentTitle();q=Wa+(q?": "+q:"");a("title:first").text(q)},D=function(){var q=a("#canvas_width"),B=
|
||||
q.val(),K=a("#canvas_height"),Q=K.val();if(B!="fit"&&!svgedit.units.isValidUnit("width",B)){a.alert(e.notification.invalidAttrValGiven);q.parent().addClass("error");return false}q.parent().removeClass("error");if(Q!="fit"&&!svgedit.units.isValidUnit("height",Q)){a.alert(e.notification.invalidAttrValGiven);K.parent().addClass("error");return false}K.parent().removeClass("error");if(!f.setResolution(B,Q)){a.alert(e.notification.noContentToFitTo);return false}b.img_save=a("#image_save_opts :checked").val();
|
||||
a.pref("img_save",b.img_save);Tb();ha()},G=function(){var q=a("#bg_blocks div.cur_background").css("background-color")||"#FFF";o(q,a("#canvas_bg_url").val());q=a("#lang_select").val();q!=b.lang&&c.putLocale(q);aa(a("#iconsize").val());d.gridSnapping=a("#grid_snapping_on")[0].checked;d.snappingStep=a("#grid_snapping_step").val();d.showRulers=a("#show_rulers")[0].checked;a("#rulers").toggle(d.showRulers);d.showRulers&&da();d.baseUnit=a("#base_unit").val();f.setConfig(d);Tb();ka()},H=c.setIcon=function(q,
|
||||
B){var K=typeof B==="string"?a.getSvgIcon(B,true):B.clone();K?a(q).append(K):console.log("NOTE: Icon image missing: "+B)},P;P=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,B=document.getElementsByTagName("script")[0],K;for(K in B.style)if(q.test(K))return K.match(q)[0];if("WebkitOpacity"in B.style)return"Webkit";if("KhtmlOpacity"in B.style)return"Khtml";return""}();var R=function(q,B){P.toLowerCase();var K=["top","left","bottom","right"];q.each(function(){for(var Q=a(this),W=Q.outerWidth()*
|
||||
(B-1),ia=Q.outerHeight()*(B-1),va=0;va<4;va++){var ya=K[va],Da=Q.data("orig_margin-"+ya);if(Da==null){Da=parseInt(Q.css("margin-"+ya));Q.data("orig_margin-"+ya,Da)}Da=Da*B;if(ya==="right")Da+=W;else if(ya==="bottom")Da+=ia;Q.css("margin-"+ya,Da)}})},aa=c.setIconSize=function(q,B){if(!(q==b.size&&!B)){console.log("size",q);var K=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),
|
||||
B){var K=typeof B==="string"?a.getSvgIcon(B,true):B.clone();K?a(q).find("img").replaceWith(K):console.log("NOTE: Icon image missing: "+B)},P;P=function(){var q=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,B=document.getElementsByTagName("script")[0],K;for(K in B.style)if(q.test(K))return K.match(q)[0];if("WebkitOpacity"in B.style)return"Webkit";if("KhtmlOpacity"in B.style)return"Khtml";return""}();var R=function(q,B){P.toLowerCase();var K=["top","left","bottom","right"];q.each(function(){for(var Q=a(this),
|
||||
W=Q.outerWidth()*(B-1),ia=Q.outerHeight()*(B-1),va=0;va<4;va++){var ya=K[va],Da=Q.data("orig_margin-"+ya);if(Da==null){Da=parseInt(Q.css("margin-"+ya));Q.data("orig_margin-"+ya,Da)}Da=Da*B;if(ya==="right")Da+=W;else if(ya==="bottom")Da+=ia;Q.css("margin-"+ya,Da)}})},aa=c.setIconSize=function(q,B){if(!(q==b.size&&!B)){console.log("size",q);var K=a("#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout"),
|
||||
Q=1;Q=typeof q=="number"?q:{s:0.75,m:1,l:1.25,xl:1.5}[q];c.tool_scale=S=Q;Gb();var W=K.parents(":hidden");W.css("visibility","hidden").show();R(K,Q);W.css("visibility","visible").hide();a.pref("iconsize",q);a("#iconsize").val(q);W={"#tools_top":{left:50,height:72},"#tools_left":{width:31,top:74},"div#workarea":{left:38,top:74}};K=a("#tool_size_rules");if(K.length)K.empty();else K=a('<style id="tool_size_rules"></style>').appendTo("head");if(q!="m"){var ia="";a.each(W,function(va,ya){va="#svg_editor "+
|
||||
va.replace(/,/g,", #svg_editor");ia+=va+"{";a.each(ya,function(Da,Ha){if(typeof Ha==="number")var Aa=Ha*Q+"px";else if(Ha[q]||Ha.all)Aa=Ha[q]||Ha.all;ia+=Da+":"+Aa+";"});ia+="}"});W="-"+P.toLowerCase()+"-";ia+="#tools_top .toolset, #editor_panel > *, #history_panel > *,\t\t\t\t#main_button, #tools_left > *, #path_node_panel > *, #multiselected_panel > *,\t\t\t\t#g_panel > *, #tool_font_size > *, .tools_flyout{"+W+"transform: scale("+Q+");} #svg_editor div.toolset .toolset {"+W+"transform: scale(1); margin: 1px !important;} #svg_editor .ui-slider {"+
|
||||
W+"transform: scale("+1/Q+");}";K.text(ia)}Gb()}},ua=function(){a("#dialog_box").hide();if(!Ia&&!Qa&&!Ka)Ua&&f.leaveContext();else{if(Ia)ra!==a("#svg_source_textarea").val()?a.confirm(e.notification.QignoreSourceChanges,function(q){q&&wa()}):wa();else if(Qa)ha();else Ka&&ka();xa()}},wa=function(){a("#svg_source_editor").hide();Ia=false;a("#svg_source_textarea").blur()},ha=function(){a("#svg_docprops").hide();a("#canvas_width,#canvas_height").removeAttr("disabled");a("#resolution")[0].selectedIndex=
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
Index: editor/units.js
|
||||
===================================================================
|
||||
--- editor/units.js (revision 2080)
|
||||
+++ editor/units.js (working copy)
|
||||
@@ -267,7 +267,7 @@
|
||||
// not already present
|
||||
try {
|
||||
var elem = elementContainer_.getElement(val);
|
||||
- result = (elem == null);
|
||||
+ result = (elem == null || svgCanvas.getSelectedElems()[0].id == val);
|
||||
} catch(e) {}
|
||||
return result;
|
||||
} else {
|
||||
|
||||
Index: editor/svg-editor.js
|
||||
===================================================================
|
||||
--- editor/svg-editor.js (revision 2080)
|
||||
+++ editor/svg-editor.js (working copy)
|
||||
@@ -1909,12 +1914,14 @@
|
||||
var attr = this.getAttribute("data-attr");
|
||||
var val = this.value;
|
||||
var valid = svgedit.units.isValidUnit(attr, val);
|
||||
-
|
||||
if(!valid) {
|
||||
$.alert(uiStrings.notification.invalidAttrValGiven);
|
||||
this.value = selectedElement.getAttribute(attr);
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
Index: editor/svgcanvas.js
|
||||
===================================================================
|
||||
--- editor/svgcanvas.js (revision 2067)
|
||||
+++ editor/svgcanvas.js (working copy)
|
||||
@@ -1227,6 +1227,19 @@
|
||||
changes.y2 = pt2.y;
|
||||
|
||||
case "text":
|
||||
+ var tspan = selected.querySelectorAll('tspan');
|
||||
+ var i = tspan.length
|
||||
+ while(i--) {
|
||||
+ var offsetX = selected.getAttribute('x') - tspan[i].getAttribute('x');
|
||||
+ var offsetY = selected.getAttribute('y') - tspan[i].getAttribute('y');
|
||||
+ var offset = {
|
||||
+ x: changes.x - offsetX,
|
||||
+ y: changes.y - offsetY,
|
||||
+ }
|
||||
+ assignAttributes(tspan[i], offset, 1000, true);
|
||||
+ }
|
||||
+ finishUp();
|
||||
+ break;
|
||||
case "use":
|
||||
finishUp();
|
||||
break;
|
Loading…
Reference in New Issue