fix bug in arc, (and palette appearance)

pull/122/head
Michael 2022-08-25 10:16:35 +02:00
rodzic 6135ce8a81
commit 0a38192b3d
4 zmienionych plików z 50 dodań i 34 usunięć

Wyświetl plik

@ -4,7 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>TurtleStitch</title> <title>TurtleStitch</title>
<link rel="shortcut icon" href="stitchcode/favicon-32x32.png" type="image/png" /> <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/morphic.js?version=2022-01-28"></script>
<script src="src/symbols.js?version=2021-03-03"></script> <script src="src/symbols.js?version=2021-03-03"></script>
<script src="src/widgets.js?version=2021-17-09"></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> <script src="src/FileSaver.min.js?version=2019-06-27"></script>
<!-- three.js --> <!-- three.js -->
<script type="text/javascript" src="stitchcode/three-newer/three.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/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/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/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/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/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/assets/turtle.js?version=2021-12-14"></script>
<script type="text/javascript" src="stitchcode/fonts/simplex.js?version=2021-12-14"></script> <script type="text/javascript" src="stitchcode/fonts/simplex.js?version=2021-12-14"></script>
<!-- turtlestitch additions --> <!-- turtlestitch additions -->
<script type="text/javascript" src="stitchcode/turtleShepherd.js?version=2021-12-14"></script> <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/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/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">
var world; var world;

Wyświetl plik

@ -149,7 +149,7 @@ SpriteMorph.prototype.categories =
'lists', 'lists',
'other' 'other'
]; ];
SpriteMorph.prototype.blockColor = { SpriteMorph.prototype.blockColor = {
motion : new Color(74, 108, 212), motion : new Color(74, 108, 212),
looks : new Color(143, 86, 227), looks : new Color(143, 86, 227),

Wyświetl plik

@ -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);
} }
}); });

Wyświetl plik

@ -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),
@ -478,41 +493,42 @@ 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)