Commit graph

96 commits

Author SHA1 Message Date
563c0d3e29 remove console.logs (totally or replace with console.debug) 2025-09-10 17:55:29 +02:00
236d612c20 fix CanvasRenderer#getWindowSize being able to return {undefined, undefined} thus causing errors in math down the line 2025-09-10 17:50:31 +02:00
6e666c0265 further fixes to error reporting: extra context, disable colour 2025-09-10 16:24:11 +02:00
3999dd3012 fix disconnect screen taking precedence over error screen
closes #68
2025-09-10 16:11:12 +02:00
2810fe248f make the brush box work under the new GPU renderer
the brush preview will need separate treatment, but it shouldn't be too difficult
2025-09-09 22:07:30 +02:00
63d5c04a0d make the brush renderer draw lines well 2025-09-09 21:02:32 +02:00
85dce88ec2 fix synchronisation between users 2025-09-09 21:02:25 +02:00
1bbf1b1d94 implementing more chunk ops based on GPU
composing, toEdits
2025-09-08 23:01:22 +02:00
bb55e23979 initial implementation of WebGL-based brush renderer 2025-09-08 18:54:32 +02:00
b4c3260f49 remove tiny-skia and replace chunk renderer with a GPU-based one 2025-09-06 23:19:28 +02:00
914da923f7 update built-in examples to use newly introduced syntax 2025-09-03 23:31:47 +02:00
449f2b59df disable ligatures in code
it can be hard for first-time users to understand what these ligatures mean or how to type them
2025-09-02 20:04:09 +02:00
29a80854a4 fix parsing prefix operators in calls 2025-09-02 18:47:56 +02:00
b52c1b26c9 overhaul operator precedence
arithmetic operators now have the same precedence.
if you want them to bind tighter, you remove the spaces around them:

- 2 + 2 * 2 = 8
- 2 + 2*2 = 6
2025-09-01 22:43:41 +02:00
09f2292e62 remove leftover limits from haku-wasm 2025-09-01 22:43:25 +02:00
64e2489979 remove leftover code from painter 2025-09-01 22:42:28 +02:00
b9a161d474 make it possible to use the characters ' and ? anywhere in identifiers
closes #129
2025-09-01 17:18:29 +02:00
731046d1f7 update example brushes; add builtin/dashes 2025-07-01 00:57:01 +02:00
bff899c9c0 removing server-side brush rendering
brush rendering is now completely client-side.
the server only receives edits the client would like to do, in the form of PNG images of chunks, that are then composited onto the wall

known issue: it is possible to brush up against the current 256 chunk edit limit pretty easily.
I'm not sure it can be solved very easily though. the perfect solution would involve splitting up the interaction into multiple edits, and I tried to do that, but there's a noticable stutter for some reason that I haven't managed to track down yet.
so it'll be kinda crap for the time being.
2025-06-30 18:55:53 +02:00
15a1bf8036 make context menus appear above resize handles
i kinda hate how shoddy this has to be
2025-06-28 23:51:52 +02:00
d5e2fbd0cf add scrollbar to error panel 2025-06-28 10:51:00 +02:00
1d2f98348f add a bit of padding to the error box 2025-06-28 09:40:18 +02:00
0ddc42c00f sidebar layout
switch the app from floating panels to a static sidebar on the right with resizable tools
expect more layout bugs from now on
2025-06-27 23:24:09 +02:00
b4acab2c9c fix jank when moving the mouse cursor outside the canvas
mouse events are now consistently sourced from the window, so if you try to draw and move your mouse over the panel, it won't glitch out
2025-06-26 18:54:28 +02:00
a40480a464 add interpolation to cursor reticles
cursor reticles are now interpolated to the update interval, so they should be smooth at > 60 fps
2025-06-26 18:48:48 +02:00
bebc2daa95 alter color selection algorithm
it should be more fair i think. maybe
2025-06-26 18:48:28 +02:00
d445eb9915 debounce updateUrl; make debounce always execute a function call after at least one is dropped
this should also fix the issue where the cursor position sometimes ends up at the wrong position after you stop moving
2025-06-26 17:33:25 +02:00
2a783aba71 make zooming zoom toward the mouse cursor 2025-06-26 17:18:52 +02:00
385a691e3e make the brush discard dialogue more clear
change text from 'Yes' to 'Discard changes and switch brush'
2025-06-26 01:22:15 +02:00
7a52dbebd0 fix some rough edges around stack traces
hide irrelevant CallFrames
fix span info for the implicit stack frame
2025-06-25 21:11:02 +02:00
e49885c83a stack traces in the brush editor
after 35 thousand years it's finally here
good erro message
2025-06-25 20:51:45 +02:00
c1612b2a94 brush picker! 2025-06-19 13:48:12 +02:00
9b82b211b4 hide brush cost gauges if they're irrelevant 2025-06-17 00:18:48 +02:00
8b464d50f4 haku: more cleanups: remove old unused VM
also remove some leftover TODOs
2025-06-16 18:57:51 +02:00
c80cd1c7fe haku1 API cleanups (removing 2 suffix) 2025-06-16 18:34:28 +02:00
00a48527ca haku2: add stats + fix crash w uninit vm 2025-06-16 16:40:01 +02:00
e667c6336a haku2: on the client
resource indicators are currently unimplemented
2025-06-15 21:30:37 +02:00
598c0348f6 fix viewport shrinking permanently (#113)
what was happening is we were setting style.width and style.height which overrode the styles from CSS that gave us the BoundingClientRect from which we were calculating the canvas size
I also added a sendViewportUpdate to prevent chunk jank
2025-05-27 22:25:30 +02:00
2b924c3efb make squigglies render themselves correctly over multiple lines
turns out there was a stupid typo, and the diagnostic's firstLine was == its lastLine
2025-05-26 21:53:03 +02:00
6b82593414 add zoom indicator in lower left corner (#39)
it looks like this:

  - 3200% +

I'm giving up on the 100% zoom button from the original idea, because rkgk's scaling curve makes it easy to go back to 100% if you need to.
2025-05-26 20:23:26 +02:00
c4f6f80166 make Backspace delete the current selection correctly (#108) 2025-05-26 19:07:44 +02:00
39886291cf HiDPI support
the main canvas is now DPI-aware; it should no longer be pixelated on 4k
this couldn't be done for the brush preview, so it's just kinda pixelated
also fixed the horrendous scrollbar that could appear on HiDPI for some reason
2025-05-25 21:26:21 +02:00
273eaa6ce3 docs.css: fix the size of the left grid column 2024-10-25 23:36:54 +02:00
dd955b0649 code-editor: make Backspace remove full indents at the start of a line 2024-10-25 23:08:12 +02:00
10d384f3d7 brush-cost: prevent percentage values from overflowing 2024-10-25 21:46:05 +02:00
913d65b0a8 implement brush cost gauges
they're a little ugly at the moment, and can be a little useless for most simple brushes, but whatever we'll make them better later
2024-10-25 21:39:53 +02:00
718e574d3a fix broken defaultBrush in editor
JS interprets escape sequences in backtick literals
2024-10-23 21:21:09 +02:00
37ff06c704 remove unneeded console.log 2024-10-23 19:45:58 +02:00
d6bb4e9911 make code examples horizontally scrollable 2024-10-23 19:45:39 +02:00
5b7d9586ea introduce tags, structs, and reticles
this was meant to be split into smaller changes, but I realised I edited my existing revision too late.
2024-10-22 21:39:04 +02:00