kopia lustrzana https://github.com/backface/turtlestitch
fix bug in arc, (and palette appearance)
rodzic
6135ce8a81
commit
0a38192b3d
|
@ -46,9 +46,9 @@
|
||||||
<script type="text/javascript" src="stitchcode/symbols.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/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/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/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/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/gui.js?version=2022-08-05"></script>
|
||||||
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script>
|
<script type="text/javascript" src="stitchcode/store.js?version=2022-06-14"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
VERSION="2.7.7"
|
VERSION="2.7.8.2"
|
||||||
|
|
||||||
// get debug mode
|
// get debug mode
|
||||||
url = new URL(window.location.href);
|
url = new URL(window.location.href);
|
||||||
|
@ -1945,8 +1945,8 @@ IDE_Morph.prototype.createCategories = function () {
|
||||||
|
|
||||||
button.category = category;
|
button.category = category;
|
||||||
button.corner = 8;
|
button.corner = 8;
|
||||||
button.padding = 0;
|
button.padding = 2;
|
||||||
button.labelShadowOffset = new Point(-1, -1);
|
button.labelShadowOffset = new Point(0,0);
|
||||||
button.labelShadowColor = colors[1];
|
button.labelShadowColor = colors[1];
|
||||||
button.labelColor = myself.buttonLabelColor;
|
button.labelColor = myself.buttonLabelColor;
|
||||||
if (MorphicPreferences.isFlat) {
|
if (MorphicPreferences.isFlat) {
|
||||||
|
@ -2016,7 +2016,7 @@ IDE_Morph.prototype.createCategories = function () {
|
||||||
button.setPosition(new Point(
|
button.setPosition(new Point(
|
||||||
l + (col * xPadding + ((col - 1) * buttonWidth)),
|
l + (col * xPadding + ((col - 1) * buttonWidth)),
|
||||||
t + ((row + 1) * yPadding + (row * buttonHeight) + border) +
|
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 {
|
} else {
|
||||||
myself.categories.setHeight(
|
myself.categories.setHeight(
|
||||||
(4 + 1) * yPadding
|
(4 + 1) * yPadding
|
||||||
+ 4 * buttonHeight
|
+ 5 * buttonHeight
|
||||||
+ (more ?
|
+ (more ?
|
||||||
(more * (yPadding + buttonHeight) + border + 2)
|
(more * (yPadding + buttonHeight) + border + 2)
|
||||||
: 0)
|
: 0)
|
||||||
|
@ -2055,7 +2055,7 @@ IDE_Morph.prototype.createCategories = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
SpriteMorph.prototype.categories.forEach(cat => {
|
SpriteMorph.prototype.categories.forEach(cat => {
|
||||||
if (!contains(['lists', 'other'], cat)) {
|
if (!contains(['lists', 'aa'], cat)) {
|
||||||
addCategoryButton(cat);
|
addCategoryButton(cat);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,6 +16,21 @@ SpriteMorph.prototype.categories =
|
||||||
'other',
|
'other',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
SpriteMorph.prototype.categories =
|
||||||
|
[
|
||||||
|
'motion',
|
||||||
|
'sensing',
|
||||||
|
'pen',
|
||||||
|
'embroidery',
|
||||||
|
'control',
|
||||||
|
'operators',
|
||||||
|
'variables',
|
||||||
|
'colors',
|
||||||
|
'other',
|
||||||
|
'lists',
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
SpriteMorph.prototype.blockColor = {
|
SpriteMorph.prototype.blockColor = {
|
||||||
motion : new Color(74, 108, 212),
|
motion : new Color(74, 108, 212),
|
||||||
pen : new Color(0, 161, 120),
|
pen : new Color(0, 161, 120),
|
||||||
|
@ -479,40 +494,41 @@ SpriteMorph.prototype.forwardBy = function (totalsteps, stepsize) {
|
||||||
|
|
||||||
SpriteMorph.prototype.arcRight = function (radius, degrees) {
|
SpriteMorph.prototype.arcRight = function (radius, degrees) {
|
||||||
if (degrees > 0) {
|
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.turn(5);
|
||||||
this.forward(radius * 0.174532)
|
this.forward(radius * 0.174532)
|
||||||
this.turn(5)
|
this.turn(5)
|
||||||
}
|
}
|
||||||
if (degrees % 10 !== 0) {
|
if (degrees % 10 !== 0) {
|
||||||
this.turn((degrees % 10)/2);
|
this.turn((degrees % 10)/2.0);
|
||||||
this.forward(((radius * 0.174532) / 10) / (degrees % 10))
|
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
|
||||||
this.turn((degrees % 10)/2 )
|
this.turn((degrees % 10)/2.0 )
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
SpriteMorph.prototype.arcLeft = function (radius, degrees) {
|
||||||
if (degrees > 0) {
|
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.turn(-5);
|
||||||
this.forward(radius * 0.174532)
|
this.forward(radius * 0.174532)
|
||||||
this.turn(-5)
|
this.turn(-5)
|
||||||
}
|
}
|
||||||
if (degrees % 10 !== 0) {
|
if (degrees % 10 !== 0) {
|
||||||
this.turn(-((degrees % 10)/2));
|
this.turn(-((degrees % 10)/2.0));
|
||||||
this.forward(((radius * 0.174532) / 10) / (degrees % 10))
|
this.forward((radius * 0.174532) / (10.0 / (degrees % 10)))
|
||||||
this.turn(-((degrees % 10)/2))
|
this.turn(-((degrees % 10)/2.0))
|
||||||
}
|
}
|
||||||
} else {
|
} 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) {
|
SpriteMorph.prototype.forwardSegemensWithEndCheck = function(steps, stepsize) {
|
||||||
for(i=0;i<steps;i++) {
|
for(i=0;i<steps;i++) {
|
||||||
if (this.stitchtype == "tatami" && i == 0 && this.stitchoptions.center)
|
if (this.stitchtype == "tatami" && i == 0 && this.stitchoptions.center)
|
||||||
|
|
Ładowanie…
Reference in New Issue