Closed yozachar closed 1 year ago
Same error when trying to put the slider at zero in the demo:
These are due to trying to create 0
-width boxes in the demo, a simple fix is:
diff --git a/examples/demo/demo.nim b/examples/demo/demo.nim
index ccbe387..33b19f7 100644
--- a/examples/demo/demo.nim
+++ b/examples/demo/demo.nim
@@ -120,11 +120,12 @@ proc basicControls() =
stroke "#70bdcf"
cornerRadius 5
strokeWeight 1
- rectangle "fill":
- progress = selectedButton.len / 5 * 100
- box 2, 2, int((parent.box.w - 4) * (progress/100)), 8
- fill "#9fe7f8"
- cornerRadius 5
+ if selectedButton.len > 0:
+ rectangle "fill":
+ progress = selectedButton.len / 5 * 100
+ box 2, 2, int((parent.box.w - 4) * (progress/100)), 8
+ fill "#9fe7f8"
+ cornerRadius 5
group "checkbox":
box 152, 85, 91, 20
@@ -180,11 +181,12 @@ proc basicControls() =
box pipPos, 0, 10, 10
fill "#72bdd0"
cornerRadius 5
- rectangle "fill":
- box 0, 3, pipPos, 4
- fill "#70bdcf"
- cornerRadius 2
- strokeWeight 1
+ if pipPos > 0:
+ rectangle "fill":
+ box 0, 3, pipPos, 4
+ fill "#70bdcf"
+ cornerRadius 2
+ strokeWeight 1
rectangle "bg":
box 0, 3, 250, 4
fill "#c2e3eb"
Error: unhandled exception Image width and height must be > 0 [PixieError]
Log
```log fidget/examples/demo on ๎ master via ๐ v1.6.0 โ nim c -r demo.nim Hint: used config file '/home/jcube/.choosenim/toolchains/nim-1.6.0/config/nim.cfg' [Conf] Hint: used config file '/home/jcube/.choosenim/toolchains/nim-1.6.0/config/config.nims' [Conf] Hint: used config file '/home/jcube/Documents/Workspace/VCServers/GitHub/fidget/config.nims' [Conf] Hint: used config file '/home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/config.nims' [Conf] ...................................................................................................................................................... /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/common.nim(6, 44) Hint: duplicate import of 'tables'; previous import here: /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/common.nim(1, 33) [DuplicateModuleImport] .................. /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/base.nim(250, 49) Warning: implicit conversion to 'cstring' from a non-const location: copy(textBox); this will become a compile time error in the future [CStringConv] /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/base.nim(256, 49) Warning: implicit conversion to 'cstring' from a non-const location: cut(textBox); this will become a compile time error in the future [CStringConv] ... /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/shaders.nim(32, 28) Warning: implicit conversion to 'cstring' from a non-const location: log; this will become a compile time error in the future [CStringConv] /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/shaders.nim(167, 60) Warning: implicit conversion to 'cstring' from a non-const location: buf; this will become a compile time error in the future [CStringConv] /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/shaders.nim(198, 61) Warning: implicit conversion to 'cstring' from a non-const location: buf; this will become a compile time error in the future [CStringConv] .... /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/formatflippy.nim(1, 63) Warning: imported and not used: 'bumpy' [UnusedImport] /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/formatflippy.nim(1, 56) Warning: imported and not used: 'vmath' [UnusedImport] ..................... /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(12, 20) Hint: 'context' should be: 'Context' [type declared in /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/context.nim(8, 3)] [Name] CC: x11_init CC: x11_monitor CC: x11_window CC: xkb_unicode CC: posix_time CC: posix_thread CC: glx_context CC: egl_context CC: osmesa_context CC: linux_joystick CC: context CC: init CC: input CC: monitor CC: vulkan CC: window CC: stdlib_digitsutils.nim CC: stdlib_assertions.nim CC: stdlib_formatfloat.nim CC: stdlib_dollars.nim CC: stdlib_io.nim CC: stdlib_system.nim CC: stdlib_hashes.nim CC: stdlib_math.nim CC: ../../../../../../../.nimble/pkgs/chroma-0.2.5/chroma/names.nim CC: stdlib_parseutils.nim CC: stdlib_unicode.nim CC: stdlib_strutils.nim CC: ../../../../../../../.nimble/pkgs/chroma-0.2.5/chroma/colortypes.nim CC: ../../../../../../../.nimble/pkgs/chroma-0.2.5/chroma/transformations.nim CC: ../../../../../../../.nimble/pkgs/chroma-0.2.5/chroma.nim CC: ../../src/fidget/input.nim CC: ../../../../../../../.nimble/pkgs/vmath-1.1.0/vmath.nim CC: stdlib_streams.nim CC: stdlib_lexbase.nim CC: stdlib_options.nim CC: stdlib_json.nim CC: stdlib_strformat.nim CC: ../../../../../../../.nimble/pkgs/bumpy-1.0.3/bumpy.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/opentype/types.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/common.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/blends.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/internal.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/masks.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/images.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/paints.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/paths.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/font.nim CC: ../../../../../../../.nimble/pkgs/flatty-0.2.3/flatty/binny.nim CC: stdlib_pathnorm.nim CC: stdlib_times.nim CC: stdlib_os.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fontformats/opentype.nim CC: stdlib_parsexml.nim CC: stdlib_strtabs.nim CC: stdlib_xmltree.nim CC: stdlib_xmlparser.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fontformats/svgfont.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fonts.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/contexts.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fileformats/bmp.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/zippyerror.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/common.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/bitstreams.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fileformats/gif.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fileformats/jpg.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/crc.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/lz77.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy/inflate.nim CC: ../../../../../../../.nimble/pkgs/zippy-0.7.3/zippy.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fileformats/png.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie/fileformats/svg.nim CC: ../../../../../../../.nimble/pkgs/pixie-3.0.2/pixie.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/opentype/parser.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/rasterizer.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/layout.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/textboxes.nim CC: stdlib_asyncfutures.nim CC: ../../src/fidget/common.nim CC: ../../src/fidget/internal.nim CC: stdlib_dynlib.nim CC: ../../../../../../../.nimble/pkgs/opengl-1.2.6/opengl.nim CC: stdlib_monotimes.nim CC: ../../src/fidget/opengl/perf.nim CC: ../../src/fidget/opengl/base.nim CC: ../../src/fidget/opengl/buffers.nim CC: ../../src/fidget/opengl/shaders.nim CC: ../../src/fidget/opengl/textures.nim CC: ../../../../../../../.nimble/pkgs/supersnappy-2.1.1/supersnappy/common.nim CC: ../../../../../../../.nimble/pkgs/supersnappy-2.1.1/supersnappy.nim CC: ../../src/fidget/opengl/formatflippy.nim CC: ../../src/fidget/opengl/context.nim CC: ../../../../../../../.nimble/pkgs/typography-#HEAD/typography/svgfont.nim CC: stdlib_nativesockets.nim CC: stdlib_base64.nim CC: stdlib_random.nim CC: stdlib_selectors.nim CC: stdlib_asyncdispatch.nim CC: stdlib_httpclient.nim CC: ../../src/fidget/openglbackend.nim CC: ../../src/fidget.nim CC: demo.nim Hint: [Link] Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code) 149499 lines; 6.419s; 348.648MiB peakmem; proj: /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/demo/demo.nim; out: /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/demo/demo [SuccessX] Hint: /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/demo/demo [Exec] [load] data/arrow.png [load] data/img9.png [load] data/img8.png [load] data/img7.png [load] data/img6.png [load] data/img5.png [load] data/img4.png [load] data/img3.png [load] data/img2.png [load] data/img1.png /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/demo/demo.nim(404) demo /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(412) startFidget /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/base.nim(144) updateLoop /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/base.nim(116) drawAndSwap /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(339) :anonymous /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(286) draw /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(286) draw /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(286) draw /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/openglbackend.nim(264) draw /home/jcube/Documents/Workspace/VCServers/GitHub/fidget/src/fidget/opengl/context.nim(537) fillRoundedRect /home/jcube/.nimble/pkgs/pixie-3.0.2/pixie/images.nim(20) newImage Error: unhandled exception: Image width and height must be > 0 [PixieError] Error: execution of an external program failed: '/home/jcube/Documents/Workspace/VCServers/GitHub/fidget/examples/demo/demo ' ```