From 080dc1db3e1aa15840ec7b7589dfb28dfb5b1ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Mon, 21 Jan 2019 14:32:08 +0400 Subject: [PATCH] Remove useless code --- editor/extensions/ext-placemark.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/editor/extensions/ext-placemark.js b/editor/extensions/ext-placemark.js index c6f58c77..8bb10a98 100644 --- a/editor/extensions/ext-placemark.js +++ b/editor/extensions/ext-placemark.js @@ -105,7 +105,6 @@ export default { font = font.join(" ") selElems.forEach((elem)=>{ if (elem && elem.getAttribute('class').indexOf('placemark')!=-1) { - let txt = []; $(elem).children().each((n,i)=>{ const type = i.id.split("_"); if(type[2]=="txt")$(i).attr({"font-family":font,"font-size":fontSize}); @@ -231,7 +230,6 @@ export default { const val = $('#placemark_marker').attr('value') || 'leftarrow'; addMarker(id, val); svgCanvas.changeSelectedAttribute(markerName, 'url(#' + id + ')'); - if (el.tagName === 'line' && pos === 'mid') { el = convertline(el); } svgCanvas.call('changed', selElems); } } @@ -336,10 +334,8 @@ export default { // const endChanges = function(){}; }, mouseDown (opts) { - const rgb = svgCanvas.getColor('fill'); - // const ccRgbEl = rgb.substring(1, rgb.length); + //const rgb = svgCanvas.getColor('fill'); const sRgb = svgCanvas.getColor('stroke'); - // const ccSRgbEl = sRgb.substring(1, rgb.length); const sWidth = svgCanvas.getStrokeWidth(); if (svgCanvas.getMode() === 'placemark') { @@ -437,12 +433,8 @@ export default { return undefined; } if (svgCanvas.getMode() === 'placemark') { - const sc = 1/svgCanvas.getZoom(); - let x = opts.mouse_x*sc; - let y = opts.mouse_y*sc; - /*if(svgCanvas.getSnapToGrid()){ - //TODO: Snap to gird. - }*/ + let x = opts.mouse_x/svgCanvas.getZoom(); + let y = opts.mouse_y/svgCanvas.getZoom(); const {fontSize,maxlen,lines,px,py} = $(newPM).attr(['fontSize','maxlen','lines','px','py']); $(newPM).attr({"x":x,"y":y}); $(newPM).children().each((n,i)=>{