add point mode

This commit is contained in:
kekee000 2014-12-15 00:20:03 +08:00
parent 7e7d72cf84
commit c488459822
10 changed files with 91 additions and 25 deletions

View File

@ -196,28 +196,10 @@ hr {
}
>[data-split] {
padding: 0;
padding: 0!important;
width: 1px;
height: 40px;
background: lighten(#707781, 15%);
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

@ -159,8 +159,27 @@ body, html {
display: block;
}
}
@media screen and (min-width:1300px) and (max-width:1600px){
.command-groups {
>li,
>li[data-theme="ico"] {
padding: 0 8px;
}
}
}
@media screen and (max-width:1300px){
.command-groups {
>li,
>li[data-theme="ico"] {
padding: 0 4px;
}
}
}
}
.editor.editing {
display: block;
}

View File

@ -100,6 +100,38 @@
}
}
.glyf-list {
&.xlarge {
>.glyf-item {
width: 160px;
.glyf {
width: 160px;
height: 160px;
}
}
}
&.large {
>.glyf-item {
width: 120px;
.glyf {
width: 120px;
height: 120px;
}
}
}
&.small {
>.glyf-item {
width: 60px;
.glyf {
width: 60px;
height: 60px;
}
}
}
}
.glyf-list.no-hover {
.glyf-item {

View File

@ -179,3 +179,11 @@
.i-tangencyshapes {
.i-ico('\e027');
}
.i-rangemode {
.i-ico('\e029');
}
.i-pointmode {
.i-ico('\e028');
}

Binary file not shown.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Binary file not shown.

View File

@ -29,7 +29,7 @@ define(
'joinshapes', 'intersectshapes', 'tangencyshapes'
],
// 单个形状
shape: ['upshape', 'downshape', 'reversepoints']
shape: ['pointmode', 'upshape', 'downshape', 'reversepoints']
};
@ -68,7 +68,7 @@ define(
});
});
var commandMenu = this.options.commandMenu;
var commandMenu = this.commandMenu;
if (commandMenu) {
editor.on('selection:change', lang.debounce(function(e) {
@ -110,6 +110,9 @@ define(
if (shapes && shapes.length) {
switch (command) {
case 'pointmode':
editor.setMode('point', shapes[0]);
break;
case 'topshape':
case 'bottomshape':
case 'upshape':
@ -144,6 +147,9 @@ define(
break;
}
}
else if (command === 'rangemode') {
editor.setMode('bound');
}
});
}
@ -169,8 +175,14 @@ define(
* @param {Object} options 参数
*/
function GLYFEditor(main, options) {
this.main = $(main);
this.options = options || {};
this.options = lang.extend({}, options);
if (this.options.commandMenu) {
this.commandMenu = this.options.commandMenu;
delete this.options.commandMenu;
}
}
/**
@ -255,7 +267,7 @@ define(
this.editor.setOptions(options);
}
else {
editorOptions.editor = options;
lang.overwrite(editorOptions.editor, options);
}
};

View File

@ -30,6 +30,19 @@ define(
{
type: 'split'
},
{
name: 'rangemode',
title: '轮廓模式',
ico: 'rangemode'
},
{
name: 'pointmode',
title: '点模式',
ico: 'pointmode'
},
{
type: 'split'
},
{
name: 'upshape',
title: '上移一层',