kopia lustrzana https://github.com/backface/turtlestitch
fix bug in arc, (and palette appearance)
rodzic
6135ce8a81
commit
0a38192b3d
30
index.html
30
index.html
|
@ -4,7 +4,7 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>TurtleStitch</title>
|
||||
<link rel="shortcut icon" href="stitchcode/favicon-32x32.png" type="image/png" />
|
||||
|
||||
|
||||
<script src="src/morphic.js?version=2022-01-28"></script>
|
||||
<script src="src/symbols.js?version=2021-03-03"></script>
|
||||
<script src="src/widgets.js?version=2021-17-09"></script>
|
||||
|
@ -30,26 +30,26 @@
|
|||
<script src="src/FileSaver.min.js?version=2019-06-27"></script>
|
||||
|
||||
<!-- three.js -->
|
||||
<script type="text/javascript" src="stitchcode/three-newer/three.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/CanvasRenderer.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/THREE.MeshLine.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/OrbitControls.old.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/Detector.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/three-newer/three.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/CanvasRenderer.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/THREE.MeshLine.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/OrbitControls.old.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threee/Detector.js?version=2021-12-14"></script>
|
||||
<!--<script type="text/javascript" src="stitchcode/three-124/LegacyJSONLoader.js"></script>-->
|
||||
|
||||
<script type="text/javascript" src="stitchcode/assets/turtle.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/fonts/simplex.js?version=2021-12-14"></script>
|
||||
|
||||
<!-- turtlestitch additions -->
|
||||
<script type="text/javascript" src="stitchcode/turtleShepherd.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/morphic.js?version=2021-12-14"></script>
|
||||
<!-- turtlestitch additions -->
|
||||
<script type="text/javascript" src="stitchcode/turtleShepherd.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/morphic.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/symbols.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/blocks.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threads.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/objects.js?version=2022-03-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/turtlecloud.js?version=2022-06-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/gui.js?version=2022-06-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/blocks.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/threads.js?version=2021-12-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/objects.js?version=2022-08-25"></script>
|
||||
<script type="text/javascript" src="stitchcode/turtlecloud.js?version=2022-06-14"></script>
|
||||
<script type="text/javascript" src="stitchcode/gui.js?version=2022-08-05"></script>
|
||||
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var world;
|
||||
|
|
|
@ -149,7 +149,7 @@ SpriteMorph.prototype.categories =
|
|||
'lists',
|
||||
'other'
|
||||
];
|
||||
|
||||
|
||||
SpriteMorph.prototype.blockColor = {
|
||||
motion : new Color(74, 108, 212),
|
||||
looks : new Color(143, 86, 227),
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
VERSION="2.7.7"
|
||||
VERSION="2.7.8.2"
|
||||
|
||||
// get debug mode
|
||||
url = new URL(window.location.href);
|
||||
|
@ -1945,8 +1945,8 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
|
||||
button.category = category;
|
||||
button.corner = 8;
|
||||
button.padding = 0;
|
||||
button.labelShadowOffset = new Point(-1, -1);
|
||||
button.padding = 2;
|
||||
button.labelShadowOffset = new Point(0,0);
|
||||
button.labelShadowColor = colors[1];
|
||||
button.labelColor = myself.buttonLabelColor;
|
||||
if (MorphicPreferences.isFlat) {
|
||||
|
@ -2016,7 +2016,7 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
button.setPosition(new Point(
|
||||
l + (col * xPadding + ((col - 1) * buttonWidth)),
|
||||
t + ((row + 1) * yPadding + (row * buttonHeight) + border) +
|
||||
(i > 7 ? border + 2 : 0)
|
||||
(i > 9 ? border + 2 : 0)
|
||||
));
|
||||
});
|
||||
|
||||
|
@ -2045,7 +2045,7 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
} else {
|
||||
myself.categories.setHeight(
|
||||
(4 + 1) * yPadding
|
||||
+ 4 * buttonHeight
|
||||
+ 5 * buttonHeight
|
||||
+ (more ?
|
||||
(more * (yPadding + buttonHeight) + border + 2)
|
||||
: 0)
|
||||
|
@ -2055,7 +2055,7 @@ IDE_Morph.prototype.createCategories = function () {
|
|||
}
|
||||
|
||||
SpriteMorph.prototype.categories.forEach(cat => {
|
||||
if (!contains(['lists', 'other'], cat)) {
|
||||
if (!contains(['lists', 'aa'], cat)) {
|
||||
addCategoryButton(cat);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -16,6 +16,21 @@ SpriteMorph.prototype.categories =
|
|||
'other',
|
||||
];
|
||||
|
||||
SpriteMorph.prototype.categories =
|
||||
[
|
||||
'motion',
|
||||
'sensing',
|
||||
'pen',
|
||||
'embroidery',
|
||||
'control',
|
||||
'operators',
|
||||
'variables',
|
||||
'colors',
|
||||
'other',
|
||||
'lists',
|
||||
];
|
||||
|
||||
|
||||
SpriteMorph.prototype.blockColor = {
|
||||
motion : new Color(74, 108, 212),
|
||||
pen : new Color(0, 161, 120),
|
||||
|
@ -478,41 +493,42 @@ SpriteMorph.prototype.forwardBy = function (totalsteps, stepsize) {
|
|||
|
||||
|
||||
SpriteMorph.prototype.arcRight = function (radius, degrees) {
|
||||
if (degrees > 0) {
|
||||
for (var n=0; n < Math.floor(degrees / 10); n++) {
|
||||
if (degrees > 0) {
|
||||
for (let n=0; n < Math.floor(degrees / 10.0); n++) {
|
||||
this.turn(5);
|
||||
this.forward(radius * 0.174532)
|
||||
this.turn(5)
|
||||
}
|
||||
if (degrees % 10 !== 0) {
|
||||
this.turn((degrees % 10)/2);
|
||||
this.forward(((radius * 0.174532) / 10) / (degrees % 10))
|
||||
this.turn((degrees % 10)/2 )
|
||||
this.turn((degrees % 10)/2.0);
|
||||
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
|
||||
this.turn((degrees % 10)/2.0 )
|
||||
}
|
||||
} else {
|
||||
throw new Error('degrees must be positive');
|
||||
// throw new Error('degrees must be positive');
|
||||
this.arcLeft(radius, Math.abs(degrees))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SpriteMorph.prototype.arcLeft = function (radius, degrees) {
|
||||
if (degrees > 0) {
|
||||
for (var n=0; n < Math.floor(degrees / 10); n++) {
|
||||
for (let n=0; n < Math.floor(degrees / 10.0); n++) {
|
||||
this.turn(-5);
|
||||
this.forward(radius * 0.174532)
|
||||
this.turn(-5)
|
||||
}
|
||||
if (degrees % 10 !== 0) {
|
||||
this.turn(-((degrees % 10)/2));
|
||||
this.forward(((radius * 0.174532) / 10) / (degrees % 10))
|
||||
this.turn(-((degrees % 10)/2))
|
||||
this.turn(-((degrees % 10)/2.0));
|
||||
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
|
||||
this.turn(-((degrees % 10)/2.0))
|
||||
}
|
||||
} else {
|
||||
throw new Error('degrees must be positive');
|
||||
//throw new Error('degrees must be positive');
|
||||
this.arcRight(radius, Math.abs(degrees))
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SpriteMorph.prototype.forwardSegemensWithEndCheck = function(steps, stepsize) {
|
||||
for(i=0;i<steps;i++) {
|
||||
if (this.stitchtype == "tatami" && i == 0 && this.stitchoptions.center)
|
||||
|
|
Ładowanie…
Reference in New Issue