Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit f741203

Browse files
authored
Merge pull request #38 from Laaouatni/35-bottom-and-right-show-wrong-ui-lines-in-gcss-simulator-but-left-and-top-correct
fix #35 solved issue in right, top... right, bottom
2 parents 32736c7 + 288758e commit f741203

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

gcode/main.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,45 @@ import Gcss from "./src/API/GcodeApi/Gsimulator/Gcss/Gcss.js";
77
let a = new G0({});
88

99
for (let i = 0; i < 3; i++) {
10-
a.moveTo({left: 50, top: 50})
10+
a.moveTo({ left: 10, top: 30 });
1111
}
1212

1313
for (let i = 0; i < 3; i++) {
14-
a.moveTo({ left: 50 })
14+
a.moveTo({ left: 100 });
1515
}
1616

1717
for (let i = 0; i < 3; i++) {
1818
a.moveTo({
19-
bottom: 50
19+
bottom: 50,
2020
});
2121
}
2222

2323
for (let i = 0; i < 3; i++) {
2424
a.moveTo({
25-
right: 50
25+
right: 100,
2626
});
2727
}
2828

2929
for (let i = 0; i < 3; i++) {
3030
a.moveTo({
31-
bottom: 50,
32-
right: 50
31+
bottom: 50,
32+
right: 50,
3333
});
3434
}
3535

3636
for (let i = 0; i < 3; i++) {
3737
a.moveTo({
38-
top: 50,
39-
right: 50
38+
top: 50,
39+
right: 20,
4040
});
4141
}
4242

4343
for (let i = 0; i < 4; i++) {
44-
a.moveTo({ left: 50 })
44+
a.moveTo({ left: 50 });
4545
}
4646

4747
for (let i = 0; i < 3; i++) {
48-
a.moveTo({ bottom: 50, left: 50 })
48+
a.moveTo({ bottom: 30, left: 50 });
4949
}
5050

5151
let g = new Gcss({

gcode/src/API/GcodeApi/Gsimulator/Gcss/CssLine/CssLine.js

-9
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ export default class CssLine {
5151
return remValue * 16;
5252
}
5353

54-
// this.previusObj.x > this.currentObj.x &&
55-
// this.previusObj.y < this.currentObj.y
56-
// ? this.biggestPos.y
57-
// : this.smallestPos.y
58-
59-
// this.previusObj.x > this.currentObj.x &&
60-
// this.previusObj.y < this.currentObj.y
61-
// ? -1 * this.lineAngle
62-
// : this.lineAngle
6354
styleLine() {
6455
this.lineStylesObj = new StyleLine(this).getResult();
6556

gcode/src/API/GcodeApi/Gsimulator/Gcss/other/Methods/StyleLine/StyleLine.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ export default class StyleLine {
7878
this.obj.previusObj.x > this.obj.currentObj.x &&
7979
this.obj.currentObj.y > this.obj.previusObj.y
8080
) {
81-
return this.obj.lineAngle + 90;
81+
return 180 - this.obj.lineAngle;
8282
}
8383

8484
// left and bottom
8585
if (
8686
this.obj.currentObj.x > this.obj.previusObj.x &&
8787
this.obj.previusObj.y > this.obj.currentObj.y
8888
) {
89-
return this.obj.lineAngle - 90;
89+
return -1 * this.obj.lineAngle;
9090
}
9191

9292
// normal all other direction

gcode/src/CSS/Gline/Gline_main/Gline_main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@
4040
width: var(--line-width);
4141
opacity: 1;
4242
}
43-
}
43+
}

0 commit comments

Comments
 (0)