putting back the ruler indicators
parent
053b6a8731
commit
ef98758752
|
@ -1771,7 +1771,6 @@
|
|||
}
|
||||
var zoom = svgCanvas.getZoom();
|
||||
var w_area = workarea;
|
||||
|
||||
zoomChanged(window, {
|
||||
width: 0,
|
||||
height: 0,
|
||||
|
@ -4523,7 +4522,7 @@
|
|||
var title_show = document.getElementById("title_show");
|
||||
var offset_x = 66;
|
||||
var offset_y = 48;
|
||||
if (svgedit.browser.isTouch()) {
|
||||
if (!svgedit.browser.isTouch()) {
|
||||
$("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers", function(e){
|
||||
e.stopPropagation();
|
||||
ruler_x_cursor.style.left = (e.pageX-offset_x+workarea.scrollLeft) + "px";
|
||||
|
|
|
@ -383,7 +383,7 @@ K=false;try{if(window.localStorage)K=localStorage}catch(da){}try{if(window.globa
|
|||
""};c.setConfig=function(z){a.each(z,function(p,L){p in o&&a.pref(p,L)});a.extend(true,d,z);if(z.extensions)d.extensions=z.extensions};c.setCustomHandlers=function(z){c.ready(function(){if(z.open){a('#tool_open > input[type="file"]').remove();a("#tool_open").show();f.open=z.open}if(z.save){c.show_save_warning=false;f.bind("saved",z.save)}z.pngsave&&f.bind("exported",z.pngsave);l=z})};c.randomizeIds=function(){f.randomizeIds(arguments)};c.init=function(){function z(q,A){var J=q.id,R=J.split("_"),W=
|
||||
R[0];R=R[1];A&&f.setStrokeAttr("stroke-"+W,R);db();Q("#cur_"+W,J,20);a(q).addClass("current").siblings().removeClass("current")}function p(q,A){a.pref("bkgd_color",q);a.pref("bkgd_url",A);f.setBackground(q,A)}function L(){var q=f.getHref(Y);q=q.indexOf("data:")===0?"":q;a.prompt(e.notification.enterNewImgURL,q,function(A){A&&La(A)})}function T(){if(f.deleteCurrentLayer()){Za();Fb();a("#layerlist tr.layer").removeClass("layersel");a("#layerlist tr.layer:first").addClass("layersel")}}function N(){var q=
|
||||
f.getCurrentDrawing().getCurrentLayerName()+" copy";a.prompt(e.notification.enterUniqueLayerName,q,function(A){if(A)if(f.getCurrentDrawing().hasLayer(A))a.alert(e.notification.dupeLayerName);else{f.cloneLayer(A);Za();Fb()}})}function K(q){var A=a("#layerlist tr.layersel").index(),J=f.getCurrentDrawing().getNumLayers();if(A>0||A<J-1){A+=q;f.setCurrentLayerPosition(J-A-1);Fb()}}function da(q,A){var J=document.getElementById("ruler_x_cursor"),R=document.getElementById("ruler_y_cursor"),W=document.getElementById("workarea");
|
||||
document.getElementById("title_show");svgedit.browser.isTouch()&&a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(oc){oc.stopPropagation();J.style.left=oc.pageX-66+W.scrollLeft+"px";R.style.top=oc.pageY-48+W.scrollTop+"px"});A||(A=f.getZoom());q||(q=a("#svgcanvas"));for(var ha=f.getContentElem(),va=svgedit.units.getTypeMap()[d.baseUnit],xa=0;xa<2;xa++){var Ca=xa===0,Ba=Ca?"x":"y",Aa=Ca?"width":"height",yb=ha.getAttribute(Ba)-0;Ba=a("#ruler_"+Ba+" canvas:first");$hcanv=Ba.clone();
|
||||
document.getElementById("title_show");svgedit.browser.isTouch()||a("#workarea").unbind("mousemove.rulers").bind("mousemove.rulers",function(oc){oc.stopPropagation();J.style.left=oc.pageX-66+W.scrollLeft+"px";R.style.top=oc.pageY-48+W.scrollTop+"px"});A||(A=f.getZoom());q||(q=a("#svgcanvas"));for(var ha=f.getContentElem(),va=svgedit.units.getTypeMap()[d.baseUnit],xa=0;xa<2;xa++){var Ca=xa===0,Ba=Ca?"x":"y",Aa=Ca?"width":"height",yb=ha.getAttribute(Ba)-0;Ba=a("#ruler_"+Ba+" canvas:first");$hcanv=Ba.clone();
|
||||
Ba.replaceWith($hcanv);var Ta=$hcanv[0];var ja=Ba=q[Aa]()*2;Ta.parentNode.style[Aa]=ja+"px";var Bb=0,cb,Ea=Ta.getContext("2d");Ea.fillStyle="rgb(200,0,0)";Ea.fillRect(0,0,Ta.width,Ta.height);$hcanv.siblings().remove();if(Ba>=3E4){var Va=parseInt(Ba/3E4)+1;cb=Array(Va);cb[0]=Ea;for(var Ha=1;Ha<Va;Ha++){Ta[Aa]=3E4;var kb=Ta.cloneNode(true);Ta.parentNode.appendChild(kb);cb[Ha]=kb.getContext("2d")}kb[Aa]=Ba%3E4;Ba=3E4}Ta[Aa]=Ba;Aa=va*A;var eb=50/Aa;Ta=1;for(Ha=0;Ha<gc.length;Ha++){Ta=Va=gc[Ha];if(eb<=
|
||||
Va)break}eb=Ta*Aa;Ea.font="normal 9px 'Lucida Grande', sans-serif";Ea.fillStyle="#777";for(var lb=yb/Aa%Ta*Aa,Xb=lb-eb;lb<ja;lb+=eb){Xb+=eb;Ha=Math.round(lb)+0.5;if(Ca){Ea.moveTo(Ha,15);Ea.lineTo(Ha,0)}else{Ea.moveTo(15,Ha);Ea.lineTo(0,Ha)}Va=(Xb-yb)/Aa;if(Ta>=1)Ha=Math.round(Va);else{Ha=(Ta+"").split(".")[1].length;Ha=Va.toFixed(Ha)-0}if(Ha!==0&&Ha!==1E3&&Ha%1E3===0)Ha=Ha/1E3+"K";if(Ca){Ea.fillText(Ha,lb+2,8);Ea.fillStyle="#777"}else{Va=(Ha+"").split("");for(Ha=0;Ha<Va.length;Ha++){Ea.fillText(Va[Ha],
|
||||
1,lb+9+Ha*9);Ea.fillStyle="#777"}}Va=eb/10;for(Ha=1;Ha<10;Ha++){var Ob=Math.round(lb+Va*Ha)+0.5;if(cb&&Ob>Ba){Bb++;Ea.stroke();if(Bb>=cb.length){Ha=10;lb=ja;continue}Ea=cb[Bb];lb-=3E4;Ob=Math.round(lb+Va*Ha)+0.5}var Wb=Ha%2?12:10;if(Ca){Ea.moveTo(Ob,15);Ea.lineTo(Ob,Wb)}else{Ea.moveTo(15,Ob);Ea.lineTo(Wb,Ob)}}}Ea.strokeStyle="#666";Ea.stroke()}}(function(){var q=window.opener;if(q)try{var A=q.document.createEvent("Event");A.initEvent("svgEditorReady",true,true);q.document.documentElement.dispatchEvent(A)}catch(J){}})();
|
||||
|
|
Loading…
Reference in New Issue