diff --git a/nico.nim b/nico.nim index 2a7650f..4c821e4 100644 --- a/nico.nim +++ b/nico.nim @@ -1911,7 +1911,7 @@ proc shear(radians: float32, x,y: int32): (int32, int32) {.inline.} = var newX = x.float32 var newY = y.float32 - # if angle is > 90 and 270, + # if angle is > 90 and < 270, # flip the angle and the x,y (effectivement mirroring the sprite on both axes) if rad > PI/2.0 and rad < PI*1.5: rad = rad + PI @@ -1938,21 +1938,11 @@ proc blitShearRot(src: Surface, srcRect: Rect, centerX,centerY: Pint, radians: f if radians < 0: radians += 2*PI - let cosRadians = cos(radians) - let sinRadians = sin(radians) - let width = srcRect.w.float32 let height = srcRect.h.float32 - let newWidth = (round(abs(width * cosRadians) + abs(height * sinRadians)) + 1) - let newHeight = (round(abs(height * cosRadians) + abs(width * sinRadians)) + 1) let ogCenterX = round((width+1)/2 - 1) let ogCenterY = round((height+1)/2 - 1) - let dstCenterX = round((newWidth+1)/2 - 1) - let dstCenterY = round((newHeight+1)/2 - 1) - - let offsetX = centerX + (ogCenterX - dstCenterX) - width/2 - let offsetY = centerY + (ogCenterY - dstCenterY) - height/2 for i in 0.. clipMaxX or dy > clipMaxY: