@@ -336,7 +336,7 @@ proc setVertColor(buf: var seq[uint8], i: int, color: ColorRGBA) =
336336 buf[i * 4 + 3 ] = color.a
337337
338338func `*` * (m: Mat4 , v: Vec2 ): Vec2 =
339- (m * vec3 (v, 0.0 )).xy
339+ (m * vec3 (v.x, v.y , 0.0 )).xy
340340
341341proc drawQuad * (
342342 ctx: Context ,
@@ -704,7 +704,7 @@ proc beginFrame*(ctx: Context, frameSize: Vec2) =
704704 beginFrame (
705705 ctx,
706706 frameSize,
707- ortho ( 0 , frameSize.x, frameSize.y, 0 , - 1000 , 1000 )
707+ ortho [ float32 ]( 0.0 , frameSize.x, frameSize.y, 0 , - 1000.0 , 1000.0 )
708708 )
709709
710710proc endFrame * (ctx: Context ) =
@@ -720,17 +720,17 @@ proc translate*(ctx: Context, v: Vec2) =
720720 # # Translate the internal transform.
721721 ctx.mat = ctx.mat * translate (vec3 (v))
722722
723- proc rotate * (ctx: Context , angle: float ) =
723+ proc rotate * (ctx: Context , angle: float32 ) =
724724 # # Rotates the internal transform.
725- ctx.mat = ctx.mat * rotateZ (angle). mat4 ()
725+ ctx.mat = ctx.mat * rotateZ (angle)
726726
727- proc scale * (ctx: Context , scale: float ) =
727+ proc scale * (ctx: Context , s: float32 ) =
728728 # # Scales the internal transform.
729- ctx.mat = ctx.mat * scaleMat ( scale)
729+ ctx.mat = ctx.mat * scale ( vec3 (s) )
730730
731- proc scale * (ctx: Context , scale : Vec2 ) =
731+ proc scale * (ctx: Context , s : Vec2 ) =
732732 # # Scales the internal transform.
733- ctx.mat = ctx.mat * scaleMat (vec3 (scale , 1 ))
733+ ctx.mat = ctx.mat * scale (vec3 (s.x, s.y , 1 ))
734734
735735proc saveTransform * (ctx: Context ) =
736736 # # Pushes a transform onto the stack.
@@ -751,5 +751,5 @@ proc fromScreen*(ctx: Context, windowFrame: Vec2, v: Vec2): Vec2 =
751751
752752proc toScreen * (ctx: Context , windowFrame: Vec2 , v: Vec2 ): Vec2 =
753753 # # Takes a point from current transform and translates it to screen.
754- result = (ctx.mat * vec3 (v, 1 )).xy
754+ result = (ctx.mat * vec3 (v.x, v.y , 1 )).xy
755755 result .y = - result .y + windowFrame.y
0 commit comments