morepretty
This commit is contained in:
parent
3b6474b565
commit
7ea0a37013
7 changed files with 42 additions and 36 deletions
|
@ -115,9 +115,19 @@ proc main() =
|
|||
AdjustWindowRectEx(cast[LPRECT](rect.addr), WS_OVERLAPPEDWINDOW, 0, 0)
|
||||
|
||||
# Open the window.
|
||||
hwnd = CreateWindow(appName, "Win32/Pixie", WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top,
|
||||
0, 0, hInstance, nil)
|
||||
hwnd = CreateWindow(
|
||||
appName,
|
||||
"Win32/Pixie",
|
||||
WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT,
|
||||
CW_USEDEFAULT,
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top,
|
||||
0,
|
||||
0,
|
||||
hInstance,
|
||||
nil
|
||||
)
|
||||
|
||||
ShowWindow(hwnd, SW_SHOW)
|
||||
UpdateWindow(hwnd)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import pixie, wNim/[wApp, wFrame, wPaintDC, wImage]
|
||||
import pixie, wFrame, wImage], wNim/[wApp, wPaintDC
|
||||
|
||||
let
|
||||
w = 256
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
import opengl, pixie, pixie/context
|
||||
import opengl, pixie, pixie/context, staticglfw except Image
|
||||
|
||||
export pixie
|
||||
|
||||
import staticglfw except Image
|
||||
|
||||
export staticglfw except Image
|
||||
export pixie, staticglfw except Image
|
||||
|
||||
var
|
||||
dpi: float32 = 1.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import pixie, random, os
|
||||
import os, pixie, random
|
||||
|
||||
when not defined(pixieLeakCheck):
|
||||
quit("Requires -d:pixieLeakCheck")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import pixie, random, pixie/fileformats/svg
|
||||
import pixie, pixie/fileformats/svg, random
|
||||
|
||||
when not defined(pixieLeakCheck):
|
||||
quit("Requires -d:pixieLeakCheck")
|
||||
|
|
|
@ -499,20 +499,20 @@ block:
|
|||
var y = 15.float32
|
||||
|
||||
proc drawDashedLine(pattern: seq[float32]) =
|
||||
ctx.beginPath();
|
||||
ctx.setLineDash(pattern);
|
||||
ctx.moveTo(0, y);
|
||||
ctx.lineTo(300, y);
|
||||
ctx.stroke();
|
||||
y += 20;
|
||||
ctx.beginPath()
|
||||
ctx.setLineDash(pattern)
|
||||
ctx.moveTo(0, y)
|
||||
ctx.lineTo(300, y)
|
||||
ctx.stroke()
|
||||
y += 20
|
||||
|
||||
drawDashedLine(@[]);
|
||||
drawDashedLine(@[1.float32, 1]);
|
||||
drawDashedLine(@[10.float32, 10]);
|
||||
drawDashedLine(@[20.float32, 5]);
|
||||
drawDashedLine(@[15.float32, 3, 3, 3]);
|
||||
drawDashedLine(@[20.float32, 3, 3, 3, 3, 3, 3, 3]);
|
||||
drawDashedLine(@[12.float32, 3, 3]);
|
||||
drawDashedLine(@[])
|
||||
drawDashedLine(@[1.float32, 1])
|
||||
drawDashedLine(@[10.float32, 10])
|
||||
drawDashedLine(@[20.float32, 5])
|
||||
drawDashedLine(@[15.float32, 3, 3, 3])
|
||||
drawDashedLine(@[20.float32, 3, 3, 3, 3, 3, 3, 3])
|
||||
drawDashedLine(@[12.float32, 3, 3])
|
||||
|
||||
image.writeFile("tests/images/context/setLineDash_1.png")
|
||||
|
||||
|
|
Loading…
Reference in a new issue