morepretty

This commit is contained in:
Ryan Oldenburg 2021-05-23 21:04:58 -05:00
parent 58ccbf025a
commit 8ca46d86e3
6 changed files with 12 additions and 15 deletions

View file

@ -1,8 +1,7 @@
import bumpy, chroma, flatty/binny, os, pixie/blends, pixie/common, import bumpy, chroma, flatty/binny, os, pixie/blends, pixie/common,
pixie/context, pixie/fileformats/bmp, pixie/fileformats/gif, pixie/context, pixie/fileformats/bmp, pixie/fileformats/gif,
pixie/fileformats/jpg, pixie/fileformats/png, pixie/fileformats/svg, pixie/fileformats/jpg, pixie/fileformats/png, pixie/fileformats/svg,
pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils, pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils, vmath
vmath
export blends, bumpy, chroma, common, context, fonts, images, masks, paints, export blends, bumpy, chroma, common, context, fonts, images, masks, paints,
paths, vmath paths, vmath

View file

@ -296,13 +296,13 @@ proc clearRect*(ctx: Context, rect: Rect) =
if ctx.layer != nil: if ctx.layer != nil:
ctx.layer.fillPath( ctx.layer.fillPath(
path, path,
Paint(kind: pkSolid, color:rgbx(0, 0, 0, 0), blendMode: bmOverwrite), Paint(kind: pkSolid, color: rgbx(0, 0, 0, 0), blendMode: bmOverwrite),
ctx.mat ctx.mat
) )
else: else:
ctx.image.fillPath( ctx.image.fillPath(
path, path,
Paint(kind: pkSolid, color:rgbx(0, 0, 0, 0), blendMode: bmOverwrite), Paint(kind: pkSolid, color: rgbx(0, 0, 0, 0), blendMode: bmOverwrite),
ctx.mat ctx.mat
) )

View file

@ -1,7 +1,6 @@
import opengl, pixie, pixie/context import opengl, pixie, pixie/context, staticglfw except Image
import staticglfw except Image
export pixie export pixie, staticglfw except Image
export staticglfw except Image
var var
dpi: float32 = 1.0 dpi: float32 = 1.0

View file

@ -1,7 +1,7 @@
## Load SVG files. ## Load SVG files.
import chroma, pixie/common, pixie/images, pixie/paths, pixie/paints, strutils, vmath, import chroma, pixie/common, pixie/images, pixie/paints, pixie/paths, strutils,
xmlparser, xmltree vmath, xmlparser, xmltree
const const
xmlSignature* = "<?xml" xmlSignature* = "<?xml"

View file

@ -408,7 +408,6 @@ block:
ctx.image.writeFile("tests/images/context/clip_1e.png") ctx.image.writeFile("tests/images/context/clip_1e.png")
block: block:
let ctx = newContext(newImage(300, 150)) let ctx = newContext(newImage(300, 150))

View file

@ -47,7 +47,7 @@ block:
image = newImage(100, 100) image = newImage(100, 100)
pathStr = "M 10 10 L 90 90" pathStr = "M 10 10 L 90 90"
color = rgba(255, 0, 0, 255) color = rgba(255, 0, 0, 255)
image.strokePath(pathStr, color, strokeWidth=10) image.strokePath(pathStr, color, strokeWidth = 10)
image.writeFile("tests/images/paths/pathStroke1.png") image.writeFile("tests/images/paths/pathStroke1.png")
block: block:
@ -55,7 +55,7 @@ block:
image = newImage(100, 100) image = newImage(100, 100)
pathStr = "M 10 10 L 50 60 90 90" pathStr = "M 10 10 L 50 60 90 90"
color = rgba(255, 0, 0, 255) color = rgba(255, 0, 0, 255)
image.strokePath(pathStr, color, strokeWidth=10) image.strokePath(pathStr, color, strokeWidth = 10)
image.writeFile("tests/images/paths/pathStroke2.png") image.writeFile("tests/images/paths/pathStroke2.png")
block: block:
@ -268,12 +268,12 @@ block:
image.strokePath( image.strokePath(
path, rgba(0, 0, 0, 255), vec2(5, 25), 10, lcButt, ljBevel, path, rgba(0, 0, 0, 255), vec2(5, 25), 10, lcButt, ljBevel,
dashes = @[2.float32,2] dashes = @[2.float32, 2]
) )
image.strokePath( image.strokePath(
path, rgba(0, 0, 0, 255), vec2(5, 45), 10, lcButt, ljBevel, path, rgba(0, 0, 0, 255), vec2(5, 45), 10, lcButt, ljBevel,
dashes = @[4.float32,4] dashes = @[4.float32, 4]
) )
image.strokePath( image.strokePath(