Fixed bug where eyedropper would be incorrectly disabled at times

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1945 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2011-01-28 16:48:42 +00:00
parent 262b0da7e7
commit 2a8f6fbd20
1 changed files with 3 additions and 2 deletions

View File

@ -17,8 +17,9 @@ svgEditor.addExtension("eyedropper", function(S) {
var svgcontent = S.svgcontent, var svgcontent = S.svgcontent,
svgns = "http://www.w3.org/2000/svg", svgns = "http://www.w3.org/2000/svg",
svgdoc = S.svgroot.parentNode.ownerDocument, svgdoc = S.svgroot.parentNode.ownerDocument,
svgCanvas = svgEditor.canvas,
ChangeElementCommand = svgedit.history.ChangeElementCommand, ChangeElementCommand = svgedit.history.ChangeElementCommand,
addToHistory = function(cmd) { canvas.undoMgr.addCommandToHistory(cmd); }, addToHistory = function(cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); },
currentStyle = {fillPaint: "red", fillOpacity: 1.0, currentStyle = {fillPaint: "red", fillOpacity: 1.0,
strokePaint: "black", strokeOpacity: 1.0, strokePaint: "black", strokeOpacity: 1.0,
strokeWidth: 5, strokeDashArray: null, strokeWidth: 5, strokeDashArray: null,
@ -35,7 +36,7 @@ svgEditor.addExtension("eyedropper", function(S) {
var elem = null; var elem = null;
var tool = $('#tool_eyedropper'); var tool = $('#tool_eyedropper');
// enable-eye-dropper if one element is selected // enable-eye-dropper if one element is selected
if (opts.elems.length == 1 && opts.elems[0] && if (!opts.multiselected && opts.elems[0] &&
$.inArray(opts.elems[0].nodeName, ['svg', 'g', 'use']) == -1) $.inArray(opts.elems[0].nodeName, ['svg', 'g', 'use']) == -1)
{ {
elem = opts.elems[0]; elem = opts.elems[0];