Made various fixes/changes, made new icon for connector tool

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1308 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-01-29 21:28:46 +00:00
parent 0074d7f7c0
commit 06d53a325b
4 changed files with 45 additions and 41 deletions

View File

@ -146,7 +146,7 @@ $(function() {
key: "L",
includeWith: {
button: '#tool_line',
isDefault: true,
isDefault: false,
position: 1
},
events: {

View File

@ -1,9 +1,28 @@
<svg xmlns="http://www.w3.org/2000/svg">
<g id="mode_connect">
<svg viewBox="0 0 131 156" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<line stroke-dasharray="5,5" transform="rotate(-83.0765, 60.5, 79.0001)" fill="none" stroke-width="5" stroke="#000000" id="svg_1" y2="121.004358" x2="14.899046" y1="36.995687" x1="106.101014"/>
<circle stroke-width="5" stroke="#000000" fill="#800000" id="svg_3" r="25" cy="27.5" cx="27.5"/>
<rect stroke-width="5" stroke="#000000" fill="#008000" id="svg_6" height="39" width="74" y="114.5" x="54.5"/>
<svg viewBox="0 0 24 24" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg">
<defs>
<line stroke-width="5" fill="none" stroke="#000000" id="svg_2" y2="121" x2="136" y1="7" x1="136">
<stop stop-opacity="1" stop-color="#4687a0"/>
<stop stop-opacity="1" stop-color="#ffffff"/>
</line>
<linearGradient y2="0.18359" x2="0.29688" y1="0.92188" x1="0.62109" id="svg_3">
<stop stop-opacity="1" stop-color="#417dad" offset="0"/>
<stop stop-opacity="1" stop-color="#ffffff" offset="1"/>
</linearGradient>
</defs>
<g>
<title>Layer 1</title>
<line x1="5.64676" y1="5.60056" x2="18.50037" y2="18.62557" id="svg_5" stroke="#000000" fill="none"/>
<rect opacity="0.75" stroke-width="0.5" x="0.5" y="0.5" width="9.625" height="5.125" id="svg_1" fill="url(#svg_3)" stroke="#000000"/>
<rect opacity="0.75" id="svg_4" stroke-width="0.5" x="13.75" y="18.25" width="9.625" height="5.125" fill="url(#svg_3)" stroke="#000000"/>
<g id="svg_9">
<path d="m14.57119,9.12143l-0.98244,5.18852l2.70861,-4.36084" id="svg_6" fill="#a0a0a0" stroke="#000000"/>
<path d="m14.27564,6.76258c-0.25872,0.72562 -0.40735,1.65632 -0.33812,2.15432l2.90784,1.2509c0.30961,-0.21212 1.08198,-1.1814 1.08198,-1.73736" id="svg_7" fill="url(#svg_3)" stroke="#000000"/>
<path d="m16.28893,0.37519l-2.46413,5.9304l4.76481,2.39435l2.13178,-4.96735" id="svg_8" fill="url(#svg_3)" stroke="#000000"/>
</g>
</g>
</svg>
</g>
<g id="svg_eof"/>

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -441,8 +441,8 @@
#svg_editor .flyout_arrow_horiz {
position: absolute;
bottom: 3%;
right: 5%;
bottom: -1px;
right: 0;
z-index: 10;
}
@ -690,6 +690,7 @@ span.zoom_tool {
bottom: 0px;
background-color: black;
opacity: 0.6;
z-index: 5;
}
#svg_source_editor #svg_source_container {
@ -702,6 +703,7 @@ span.zoom_tool {
opacity: 1.0;
text-align: center;
border: 1px outset #777;
z-index: 6;
}
/*

View File

@ -301,6 +301,7 @@ function svg_edit_setup() {
icon[0].setAttribute('height',shower.height());
shower.children(':not(.flyout_arrow_horiz)').remove();
shower.append(icon).attr('data-curopt', opts.sel); // This sets the current mode
shower.attr('title', $(opts.sel).attr('title'));
});
});
@ -319,12 +320,14 @@ function svg_edit_setup() {
var holder = $(show_sel.replace('_show',''));
var l = holder.css('left');
var w = holder.width()*-1;
var time = holder.data('shown_popop')?200:0;
timer = setTimeout(function() {
// Show corresponding menu
holder.css('left', w).show().animate({
left: l
},150);
},200);
holder.data('shown_popop',true);
},time);
evt.preventDefault();
}).mouseup(function() {
clearTimeout(timer);
@ -1001,6 +1004,8 @@ function svg_edit_setup() {
}
}
on_button = false;
}).mousedown(function() {
$('.tools_flyout:visible').fadeOut();
});
overlay.bind('mousedown',function() {
@ -1539,7 +1544,7 @@ function svg_edit_setup() {
});
$.resizeSvgIcons({
'.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 3,
'.flyout_arrow_horiz svg, .flyout_arrow_horiz img': size_num / 5,
'#logo > svg, #logo > img': size_num * 1.3
});
if(size != 's') {
@ -1923,42 +1928,10 @@ function svg_edit_setup() {
updateToolButtonState();
});
// (function() {
// var timer, menuShown;
// $('#tools_rect_show').mousedown(function(evt){
// timer = setTimeout(function() {
// // menuShown = true;
// $('#tools_rect').show();
// },200);
// // this prevents the 'image drag' behavior in Firefox
// evt.preventDefault();
// }).mouseup(function() {
// clearTimeout(timer);
// // var opt = $(this).attr('data-curopt',);
// });
//
//
// // $('#tools_rect').mouseleave(function(){$('#tools_rect').fadeOut();});
//
// }());
$('#tool_move_top').mousedown(function(evt){
$('#tools_stacking').show();
evt.preventDefault();
});
// $('#tools_ellipse_show').mousedown(function(evt){
// $('#tools_ellipse').show();
// // this prevents the 'image drag' behavior in Firefox
// evt.preventDefault();
// });
// $('#tools_ellipse').mouseleave(function() {$('#tools_ellipse').fadeOut();});
// $('.tool_flyout_button').mouseover(function() {
// $(this).addClass('tool_flyout_button_current');
// }).mouseout(function() {
// $(this).removeClass('tool_flyout_button_current');
// });
$('.layer_button').mousedown(function() {
$(this).addClass('layer_buttonpressed');
@ -2766,6 +2739,16 @@ function svg_edit_setup() {
svgCanvas.setIconSize('s');
}
// Look for any missing flyout icons from plugins
$('.tools_flyout').each(function() {
var shower = $('#' + this.id + '_show');
var sel = shower.attr('data-curopt');
// Check if there's an icon here
if(!shower.children('svg, img').length) {
shower.append($(sel).children().clone());
}
});
// Load source if given
var loc = document.location.href;
if(loc.indexOf('?source=') != -1) {