morepretty

This commit is contained in:
Ryan Oldenburg 2021-08-17 23:11:48 -05:00
parent fdef525352
commit 8c9daadd04
3 changed files with 6 additions and 4 deletions

View file

@ -385,7 +385,7 @@ proc clearRect*(ctx: Context, rect: Rect) =
let path = newPath() let path = newPath()
path.rect(rect) path.rect(rect)
if ctx.layer != nil: if ctx.layer != nil:
ctx.layer.fillPath( path, paint, ctx.mat) ctx.layer.fillPath(path, paint, ctx.mat)
else: else:
ctx.image.fillPath(path, paint, ctx.mat) ctx.image.fillPath(path, paint, ctx.mat)

View file

@ -15,7 +15,7 @@ type
blendMode*: BlendMode ## Blend mode. blendMode*: BlendMode ## Blend mode.
opacity*: float32 opacity*: float32
# pkSolid # pkSolid
color*: Color ## Color to fill with. color*: Color ## Color to fill with.
# pkImage, pkImageTiled: # pkImage, pkImageTiled:
image*: Image ## Image to fill with. image*: Image ## Image to fill with.
imageMat*: Mat3 ## Matrix of the filled image. imageMat*: Mat3 ## Matrix of the filled image.
@ -25,7 +25,7 @@ type
ColorStop* = object ColorStop* = object
## Color stop on a gradient curve. ## Color stop on a gradient curve.
color*: Color ## Color of the stop. color*: Color ## Color of the stop.
position*: float32 ## Gradient stop position 0..1. position*: float32 ## Gradient stop position 0..1.
SomePaint* = string | Paint | SomeColor SomePaint* = string | Paint | SomeColor

View file

@ -154,7 +154,9 @@ block:
let image = newImage(200, 100) let image = newImage(200, 100)
image.fill(rgba(255, 255, 255, 255)) image.fill(rgba(255, 255, 255, 255))
image.fillText(font, "First line") image.fillText(font, "First line")
image.fillText(font, "Second line", translate(vec2(0, font.defaultLineHeight))) image.fillText(
font, "Second line", translate(vec2(0, font.defaultLineHeight))
)
doDiff(image, "basic7") doDiff(image, "basic7")