mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Update BezierTool to work wtihout full Bootstrap.
This commit is contained in:
parent
8d5024523c
commit
20f3460222
1 changed files with 13 additions and 12 deletions
|
@ -33,6 +33,7 @@
|
||||||
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientColor.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
<script type="text/javascript" src="../../src/color/Gradient.js"></script>
|
||||||
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
<script type="text/javascript" src="../../src/color/GradientStop.js"></script>
|
||||||
|
<script type="text/javascript" src="../../src/util/Events.js"></script>
|
||||||
<script type="text/javascript" src="../../src/util/PaperScript.js"></script>
|
<script type="text/javascript" src="../../src/util/PaperScript.js"></script>
|
||||||
<script type="text/paperscript" canvas="canvas">
|
<script type="text/paperscript" canvas="canvas">
|
||||||
document.currentStyle = {
|
document.currentStyle = {
|
||||||
|
@ -69,18 +70,18 @@
|
||||||
var curRect;
|
var curRect;
|
||||||
function onMouseDown(event) {
|
function onMouseDown(event) {
|
||||||
if (event.count > 1) {
|
if (event.count > 1) {
|
||||||
var first = lastInLine.segments.first;
|
var first = lastInLine.firstSegment;
|
||||||
first.point = inLine.segments.first.point;
|
first.point = inLine.firstSegment.point;
|
||||||
var last = lastInLine.segments.last;
|
var last = lastInLine.lastSegment;
|
||||||
last.point = inLine.segments.last.point;
|
last.point = inLine.lastSegment.point;
|
||||||
lastInLine.visible = true;
|
lastInLine.visible = true;
|
||||||
lastInCircle.position = last.point;
|
lastInCircle.position = last.point;
|
||||||
}
|
}
|
||||||
currentSegment = path.add(event.point);
|
currentSegment = path.add(event.point);
|
||||||
inLine.segments.first.point = event.point;
|
inLine.firstSegment.point = event.point;
|
||||||
outLine.segments.first.point = event.point;
|
outLine.firstSegment.point = event.point;
|
||||||
inLine.segments.last.point = event.point;
|
inLine.lastSegment.point = event.point;
|
||||||
outLine.segments.last.point = event.point;
|
outLine.lastSegment.point = event.point;
|
||||||
inLine.visible = true;
|
inLine.visible = true;
|
||||||
outLine.visible = true;
|
outLine.visible = true;
|
||||||
|
|
||||||
|
@ -100,10 +101,10 @@
|
||||||
var delta = event.point - event.downPoint;
|
var delta = event.point - event.downPoint;
|
||||||
currentSegment.handleOut = delta;
|
currentSegment.handleOut = delta;
|
||||||
currentSegment.handleIn = -delta;
|
currentSegment.handleIn = -delta;
|
||||||
outLine.segments.last.point = currentSegment.handleIn + event.downPoint;
|
outLine.lastSegment.point = currentSegment.handleIn + event.downPoint;
|
||||||
inLine.segments.last.point = currentSegment.handleOut + event.downPoint;
|
inLine.lastSegment.point = currentSegment.handleOut + event.downPoint;
|
||||||
outCircle.position = outLine.segments.last.point;
|
outCircle.position = outLine.lastSegment.point;
|
||||||
inCircle.position = inLine.segments.last.point;
|
inCircle.position = inLine.lastSegment.point;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMouseUp(event) {
|
function onMouseUp(event) {
|
||||||
|
|
Loading…
Reference in a new issue