Laaouatni/gcode.js

`bottom` and `right` show wrong UI lines in Gcss simulator (but `left` and `top` correct)

Laaouatni opened this issue · 5 comments

Describe the bug
right, and bottom in MoveTo don't work in the CSS generator

they need to be attached, and the number ::before need to be in the correct x,y (displayed in the popup)

Screenshots

for (let i = 0; i < 9; i++) {
  a.moveTo({
    left: 50,
    bottom: i * 10,
  });
}

image


but with top is ok ✅
image


❌ there is a bug with right

for (let i = 0; i < 9; i++) {
  a.moveTo({
    right: 50,
  });
}

image


❌ also here the same bug with right

for (let i = 0; i < 9; i++) {
  a.moveTo({
    right: 50,
    top: i * 10,
  });
}

image

there is a bug in animation we need to solve, the positioning is correct

solved in #37

🐛another time, I find another bug!

if you use top, with right and the values aren't 45degres, this happen
image

the same for bottom and left
image

the left and bottom can be solved by getting the negative value,
-1 * this.obj.lineAngle

but for now I can't figure out the formula for the right/top

here the table of my checkings but I think there is some calculation that it will make us get the third column value

right angle the value that correct the angle UI
5 84 96
10 78 102
20 68 112
30 59 122
40 51 129
50 45 135
60 39 141
70 35 145
80 32 148
90 29 151
100 26 154
110 24 156
120 22 158
130 21 159
140 19 161
150 18 162

I figure it out now! all the angles, if you sum them if it will give you 180.

now if we do 180 - this.obj.lineAngle we will solve that

solved in #38