add join path command

This commit is contained in:
kekee000
2014-12-13 23:24:57 +08:00
parent 54323ad8ca
commit 070a698007
10 changed files with 96 additions and 8 deletions

View File

@@ -202,4 +202,22 @@ hr {
background: lighten(#707781, 15%); background: lighten(#707781, 15%);
pointer-events: none; pointer-events: none;
} }
}
@media screen and (min-width:1200px) and (max-width:1400px){
.command-groups {
>li,
>li[data-theme="ico"] {
padding: 0 8px;
}
}
}
@media screen and (max-width:1200px){
.command-groups {
>li,
>li[data-theme="ico"] {
padding: 0 4px;
}
}
} }

View File

@@ -162,4 +162,20 @@
.i-mirror { .i-mirror {
.i-ico('\e012'); .i-ico('\e012');
}
.i-splitshapes {
.i-ico('\e024');
}
.i-joinshapes {
.i-ico('\e025');
}
.i-intersectshapes {
.i-ico('\e026');
}
.i-tangencyshapes {
.i-ico('\e027');
} }

View File

@@ -127,6 +127,18 @@ a:hover {
.i-mirror:before { .i-mirror:before {
content: '\e012'; content: '\e012';
} }
.i-splitshapes:before {
content: '\e024';
}
.i-joinshapes:before {
content: '\e025';
}
.i-intersectshapes:before {
content: '\e026';
}
.i-tangencyshapes:before {
content: '\e027';
}
.glyf-editor { .glyf-editor {
width: 100%; width: 100%;
height: 100%; height: 100%;

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -255,8 +255,10 @@ define(
this.graduationMarker.dispose(); this.graduationMarker.dispose();
this.options = this.contextMenu = this.render = null; this.options = this.contextMenu = this.render = null;
this.fontLayer = this.coverLayer = this.axisLayer = this.graduationLayer = null; this.fontLayer = this.coverLayer = this.axisLayer
this.axis = this.rightSideBearing = this.graduation = this.graduationMarker = this.font = null; = this.referenceLineLayer = this.graduationLayer = null;
this.axis = this.rightSideBearing = this.graduation
= this.graduationMarker = this.font = null;
this.sorption.dispose(); this.sorption.dispose();
this.sorption = null; this.sorption = null;

View File

@@ -25,6 +25,9 @@ define(
'horizontalalignshapes', 'verticalalignshapes', 'horizontalalignshapes', 'verticalalignshapes',
'rotateleft', 'rotateright', 'flipshapes', 'mirrorshapes' 'rotateleft', 'rotateright', 'flipshapes', 'mirrorshapes'
], ],
shapes2: [
'joinshapes', 'intersectshapes', 'tangencyshapes'
],
// 单个形状 // 单个形状
shape: ['upshape', 'downshape', 'reversepoints'] shape: ['upshape', 'downshape', 'reversepoints']
}; };
@@ -72,20 +75,32 @@ define(
var length = e.shapes ? e.shapes.length : 0; var length = e.shapes ? e.shapes.length : 0;
if (!length) { if (!length) {
commandMenu.disableCommands(COMMAND_SUPPORT.shapes); commandMenu.disableCommands(COMMAND_SUPPORT.shapes);
commandMenu.disableCommands(COMMAND_SUPPORT.shapes2);
commandMenu.disableCommands(COMMAND_SUPPORT.shape); commandMenu.disableCommands(COMMAND_SUPPORT.shape);
} }
else { else {
commandMenu.enableCommands(COMMAND_SUPPORT.shapes); commandMenu.enableCommands(COMMAND_SUPPORT.shapes);
commandMenu[length >= 2 ? 'enableCommands' : 'disableCommands'](COMMAND_SUPPORT.shapes2);
commandMenu[length === 1 ? 'enableCommands' : 'disableCommands'](COMMAND_SUPPORT.shape); commandMenu[length === 1 ? 'enableCommands' : 'disableCommands'](COMMAND_SUPPORT.shape);
} }
}), 100); }), 100);
commandMenu.on('command', function(e) { commandMenu.on('command', function(e) {
// 这里延时进行focus
setTimeout(function() {
me.focus();
}, 20);
var command = e.command; var command = e.command;
var args = e.args; var args = e.args;
var shapes; var shapes;
if (command === 'splitshapes') {
editor.setMode('split');
return;
}
if (command === 'pasteshapes') { if (command === 'pasteshapes') {
shapes = editor.getClipBoard(); shapes = editor.getClipBoard();
} }
@@ -116,6 +131,9 @@ define(
case 'copyshapes': case 'copyshapes':
case 'removeshapes': case 'removeshapes':
case 'reversepoints': case 'reversepoints':
case 'joinshapes':
case 'intersectshapes':
case 'tangencyshapes':
editor.execCommand(command, shapes); editor.execCommand(command, shapes);
break; break;
@@ -127,10 +145,6 @@ define(
} }
} }
// 这里延时进行focus
setTimeout(function() {
me.focus();
}, 20);
}); });
} }

View File

@@ -126,7 +126,33 @@ define(
title: '镜像', title: '镜像',
ico: 'mirror', ico: 'mirror',
disabled: true disabled: true
} },
{
type: 'split'
},
{
name: 'splitshapes',
title: '切割轮廓',
ico: 'splitshapes'
},
{
name: 'joinshapes',
title: '合并轮廓',
ico: 'joinshapes',
disabled: true
},
{
name: 'intersectshapes',
title: '相交轮廓',
ico: 'intersectshapes',
disabled: true
},
{
name: 'tangencyshapes',
title: '相切轮廓',
ico: 'tangencyshapes',
disabled: true
},
]; ];
} }
); );