From f410e2100669672cfa03450d8d76765091c67eca Mon Sep 17 00:00:00 2001 From: Chance Roth Date: Fri, 18 Jan 2013 18:05:41 +0000 Subject: [PATCH] Added Star and Polygon Extensions - Looks like Firefox recently broke something and shows mitre ends too long. USed to work great, Chrome is fine. v.2 git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2319 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/extensions/ext-polygon.js | 233 ++++++++++++++++++++++++++ editor/extensions/ext-star.js | 248 ++++++++++++++++++++++++++++ editor/extensions/polygon-icons.svg | 14 ++ editor/extensions/star-icons.svg | 14 ++ 4 files changed, 509 insertions(+) create mode 100644 editor/extensions/ext-polygon.js create mode 100644 editor/extensions/ext-star.js create mode 100644 editor/extensions/polygon-icons.svg create mode 100644 editor/extensions/star-icons.svg diff --git a/editor/extensions/ext-polygon.js b/editor/extensions/ext-polygon.js new file mode 100644 index 00000000..64844a77 --- /dev/null +++ b/editor/extensions/ext-polygon.js @@ -0,0 +1,233 @@ +/* + * ext-polygon.js + * + * + * Copyright(c) 2010 CloudCanvas, Inc. + * All rights reserved + * + */ +svgEditor.addExtension("polygon", function(S){ + + var svgcontent = S.svgcontent, addElem = S.addSvgElementFromJson, selElems, svgns = "http://www.w3.org/2000/svg", xlinkns = "http://www.w3.org/1999/xlink", xmlns = "http://www.w3.org/XML/1998/namespace", xmlnsns = "http://www.w3.org/2000/xmlns/", se_ns = "http://svg-edit.googlecode.com", htmlns = "http://www.w3.org/1999/xhtml", editingitex = false, svgdoc = S.svgroot.parentNode.ownerDocument, started, newFO, edg = 0, newFOG, newFOGParent, newDef, newImageName, newMaskID, undoCommand = "Not image", modeChangeG; + + var ccZoom; + var wEl, hEl; + var wOffset, hOffset; + var ccRBG, ccRgbEl; + var ccOpacity; + var brushW, brushH, shape; + + var ccDebug = document.getElementById('debugpanel'); + + + /* var properlySourceSizeTextArea = function(){ + // TODO: remove magic numbers here and get values from CSS + var height = $('#svg_source_container').height() - 80; + $('#svg_source_textarea').css('height', height); + }; */ + function showPanel(on){ + var fc_rules = $('#fc_rules'); + if (!fc_rules.length) { + fc_rules = $('