Open jdxyw opened 3 years ago
Hi, I am trying to rotate a Rectangle in its center, but it seems doesn't work, below is the code. Anyone knows what's wrong with it?
Thanks!
var sideLen float64 = 10 ctex.Push() ctex.SetColor(cl) ctex.Translate(x0, y0) ctex.Rotate(gg.Radians(float64(theta))) ctex.DrawRectangle(-sideLen/2,sideLen/2,sideLen,sideLen) ctex.Fill() ctex.Pop()
Try Rotate before Translate
Rotate
Translate
Hi, I am trying to rotate a Rectangle in its center, but it seems doesn't work, below is the code. Anyone knows what's wrong with it?
Thanks!