From 652def46001a6fa7d8a9fe30711412ea69b098f1 Mon Sep 17 00:00:00 2001 From: mkwiser Date: Sat, 13 Sep 2014 16:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=82=B9=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/css/editor.css | 47 ++++++++++ demo/css/editor.less | 37 ++++++++ demo/editor.html | 4 +- src/editor/Editor.js | 68 +++++++++++--- src/editor/group/ShapeGroup.js | 8 ++ src/editor/main.js | 7 +- src/editor/menu/ContextMenu.js | 141 +++++++++++++++++++++++++++++ src/editor/menu/command.js | 81 +++++++++++++++++ src/editor/mode/bound.js | 19 +--- src/editor/mode/editorMode.js | 4 +- src/editor/mode/point.js | 157 ++++++++++++++++++++++++--------- src/editor/mode/range.js | 85 ++++++++++++++++++ src/render/capture/Mouse.js | 20 +++-- src/ttf/util/contourAdjust.js | 2 +- 14 files changed, 597 insertions(+), 83 deletions(-) create mode 100644 demo/css/editor.css create mode 100644 demo/css/editor.less create mode 100644 src/editor/menu/ContextMenu.js create mode 100644 src/editor/menu/command.js create mode 100644 src/editor/mode/range.js diff --git a/demo/css/editor.css b/demo/css/editor.css new file mode 100644 index 0000000..529d6ad --- /dev/null +++ b/demo/css/editor.css @@ -0,0 +1,47 @@ +* { + margin: 0; + padding: 0; +} +ul { + list-style: none; +} +a { + color: #03C; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +.hide { + display: none; +} +body, +html { + height: 100%; +} +#render-view { + font-size: 12px; + width: 100%; + height: 100%; + position: relative; + -webkit-text-size-adjust: none; +} +#render-view .editor-contextmenu { + width: 120px; + border: 1px solid #999; + background: #FEFEFE; + line-height: 24px; + padding: 0 4px; + box-shadow: 1px 1px 1px #CCC; +} +#render-view .editor-contextmenu div { + padding-left: 10px; + cursor: pointer; + border-bottom: 1px solid #CCC; +} +#render-view .editor-contextmenu div:hover { + background: #EEE; +} +#render-view .editor-contextmenu div:last-child { + border-bottom: none; +} diff --git a/demo/css/editor.less b/demo/css/editor.less new file mode 100644 index 0000000..d2142a1 --- /dev/null +++ b/demo/css/editor.less @@ -0,0 +1,37 @@ +@import './reset'; + +body, html { + height: 100%; +} + +#render-view { + font-size: 12px; + width: 100%; + height: 100%; + position: relative; + -webkit-text-size-adjust: none; + + .editor-contextmenu { + width: 120px; + border: 1px solid #999; + background: #FEFEFE; + line-height: 24px; + padding: 0 4px; + box-shadow: 1px 1px 1px #CCC; + + div { + padding-left: 10px; + cursor: pointer; + border-bottom: 1px solid #CCC; + } + + div:hover { + background: #EEE; + } + + div:last-child { + border-bottom: none; + } + + } +} \ No newline at end of file diff --git a/demo/editor.html b/demo/editor.html index 90c04c4..30a65cc 100644 --- a/demo/editor.html +++ b/demo/editor.html @@ -5,7 +5,7 @@ 测试render - + @@ -19,7 +19,7 @@ define('jquery', $); -
+