Commit graph

2,140 commits

Author SHA1 Message Date
Kevin Boos
3a263956c8 Restore optional serde derives that were removed in Makepad 2.0 (#973) 2026-03-19 20:07:45 +01:00
Kevin Boos
95090bbc0a Ensure that the Html <br> tag obeys current line spacing settings (#971)
Without this, Html blocks that have both `<br>` and `\n` newlines
(or even just soft line wraps) look quite janky, with poor vertical spacing.
2026-03-19 20:07:28 +01:00
Kevin Boos
9977202cfa Fixed several issue in text drawing, layout, and text flow. (#970)
These are needed to support better formatting of Html code
that mixes multiple different styles together, e.g., inline code
next to normal code, or inline code within a blockquote or a heading.

Full summary of changes:

**File:** `draw/src/shader/draw_text.rs`

Added `#[live(0.0)] pub top_drop: f32` to `TextStyle`. This is a vertical offset expressed as a fraction of font size — positive values shift text downward. It's useful for aligning baselines when mixing fonts with different vertical metrics (e.g., a code font rendered inline with regular text).

**File:** `draw/src/shader/draw_text.rs`

When `temp_y_shift != 0`, the extra shift pixels are now added to `allocate_height()` and the emitted walk rect. This prevents containers (blockquotes, etc.) from clipping the descenders (g, p, q, y) of vertically-shifted text.

**File:** `widgets/src/text_flow.rs`

After selecting the appropriate text style (normal/bold/italic/fixed), `draw_text.temp_y_shift` is now set from that style's `top_drop` value. This allows each style variant to specify its own vertical offset, since `TextFlow` uses a single shared `DrawText` instance for all text rendering.

**File:** `draw/src/turtle.rs`

New public method to mutate `layout.padding.left` after a turtle has been created.

**File:** `widgets/src/text_flow.rs`

After drawing the bullet/number marker, the actual cursor position is now measured and `set_padding_left()` is called so that wrapped continuation lines align with the text after the marker, rather than being over-indented by the estimated `font_based_padding` (which was `2.5 * font_size`).

Additionally, the hardcoded `draw_text(cx, " ")` spacer after the marker was replaced with `walk_margin(cx, self.list_item_marker_pad)` for precise pixel-based control.

**File:** `widgets/src/text_flow.rs`

Added `#[live(5.0)] list_item_marker_pad: f64` — a configurable spacing (in pixels) between the list item marker (bullet/number) and the content text that follows it.
2026-03-19 20:07:13 +01:00
Admin
3a1edd3db1 fix android screencap to studio 2026-03-19 13:59:42 +01:00
Admin
378459462c fix android screencap to studio 2026-03-19 13:57:55 +01:00
Admin
df389d7c5e fix studio 2026-03-19 12:42:27 +01:00
Admin
54249f1958 fix studio 2026-03-19 11:54:38 +01:00
Admin
c1900f6e50 fix studio 2026-03-19 11:42:20 +01:00
Admin
42df96331a fix studio 2026-03-19 11:24:51 +01:00
Admin
7b5f7a177f studio ws fix 2026-03-19 10:42:55 +01:00
Admin
9f445a6c69 cleanup 2026-03-19 10:16:38 +01:00
Admin
059f8a123c helmet with real envmap 2026-03-18 01:29:59 +01:00
Admin
8393979f7b remove dep 2026-03-18 01:02:57 +01:00
Admin
c8b0a7ad4b remove dep 2026-03-18 00:06:32 +01:00
Admin
99bd8d38d4 vulkan debugging 2026-03-17 23:59:07 +01:00
offline-ant
bcd5675051 Fix Mat4f::mul to compute a*b instead of b*a (#966)
Mat4f::mul(a, b) was computing b*a due to transposed summation
indices in the multiplication loop. All call sites (glTF TRS
composition, view-projection, MVP chains, scene hierarchy) are
written expecting standard a*b order, and transform_vec4 uses
standard column-major M*v convention.

Fix: swap the operand bindings so the existing index pattern
produces the correct a*b result.

Add regression test mat4_mul_order that verifies:
- Scale(2)*Translate(5,7) yields tx=10 (scaled translation)
- transform_vec4 on result*(1,1,0,1) yields (12,16)

Co-authored-by: ant <ant@offline.click>
2026-03-17 19:43:02 +01:00
Admin
62a7fd33f4 cef 2026-03-17 19:00:28 +01:00
Admin
c4064cef6a vulkan video textures 2026-03-17 19:00:28 +01:00
Admin
41f0384a4b vulkan video textures 2026-03-17 19:00:28 +01:00
Admin
1a24696c26 vulkan video textures 2026-03-17 19:00:28 +01:00
Admin
29ade80a88 not bad 2026-03-17 19:00:28 +01:00
Admin
b49be22327 not bad 2026-03-17 19:00:28 +01:00
Admin
1205742c3b not bad 2026-03-17 19:00:28 +01:00
Admin
3bc77d8762 ok planes 2026-03-17 19:00:28 +01:00
Admin
5e96227402 quite good 2026-03-17 19:00:28 +01:00
Admin
baecc7ba3c almost good 2026-03-17 19:00:28 +01:00
Admin
5a3b938960 almost good 2026-03-17 19:00:27 +01:00
Admin
08cd456e7a almost 2026-03-17 19:00:27 +01:00
Admin
d84922d225 almost 2026-03-17 19:00:27 +01:00
Admin
a0c8bbd18d whoa 2026-03-17 19:00:27 +01:00
Admin
45c277dc59 almost reasonable 2026-03-17 19:00:27 +01:00
Kevin Boos
7ae0178c8d fix SVG handling to support SVG files with fill "none" (#961)
Also fix splash example icon paths
2026-03-16 20:44:17 +01:00
Kevin Boos
b376a3c447 Proper widget tree fix (#956)
* Fix macos platform build failures related to PR#946

* Properly fix the new breadth-first widget tree lookup
2026-03-16 19:27:32 +01:00
Admin
a67822f5f0 fix 2026-03-16 16:13:48 +01:00
Sabin Regmi
2c0410327c fix macos, ios and wasm compilation (#957) 2026-03-16 15:18:33 +01:00
Admin
fc27eb3279 it compiles 2026-03-15 16:06:36 +01:00
Admin
771141ced9 slow voxels 2026-03-15 15:36:30 +01:00
Admin
902ae4bacc bricks 2026-03-15 13:35:58 +01:00
Admin
98bc76b705 vulkan back 2026-03-15 13:20:49 +01:00
Admin
36a29628e4 rapier vendored 2026-03-15 09:52:45 +01:00
Admin
53745d7972 physics 2026-03-15 09:52:45 +01:00
Admin
0cfd9f36e0 otw 2026-03-15 09:52:45 +01:00
Admin
209a38c704 works again 2026-03-15 09:52:44 +01:00
Admin
05e665a9f9 works again! 2026-03-15 09:52:44 +01:00
Admin
bdbb889cab zbuf back 2026-03-15 09:52:44 +01:00
Admin
bc735b20d2 fixup 2026-03-15 08:49:21 +01:00
Jason Yau
efc24d6ee2 Fix windows build errors again (#953)
* regenerate windows-rs to export D3D11_DEPTH_WRITE_MASK_ZERO constant

* fix build errors

---------

Co-authored-by: jasonqiu <jasonqiuchen@outlook.com>
2026-03-14 15:26:55 +01:00
Sabin Regmi
25fcb675e1 Expose WEB URL and Location Handling (#941)
* Add web URL/location and history handling

Sync browser location and history with the WASM app on the Web platform.

- Cx API: add default CxOsApi methods browser_update_url and browser_history_go and Cx wrappers to call them.
- Web/WASM IPC: add ToWasmLocationChange, FromWasmBrowserUpdateUrl, FromWasmBrowserHistoryGo structs for message passing and register them in init.
- Web JS: emit_location_change on popstate, and implement FromWasmBrowserUpdateUrl and FromWasmBrowserHistoryGo to update history (push/replace/back/forward/go).
- Cx web runtime: add normalize_web_pathname, split_web_location and update_web_location_state helpers; handle incoming ToWasmLocationChange to update internal state and signal events; implement browser_update_url and browser_history_go to forward requests to JS and update internal location state.

These changes enable SPA-style URL updates, history navigation, and app-side reactions to browser location changes while avoiding redundant updates.

* Handle hashchange and improve URL parsing

Add a window "hashchange" listener to emit location changes and trigger the wasm pump so fragment navigation updates are handled. Update FromWasmBrowserUpdateUrl to construct URLs relative to the current full location (window.location.href) so fragment- and relative-only updates resolve correctly. Tighten split_web_location parsing to treat '/', '?', and '#' as path delimiters after a scheme, ensuring queries and fragments are detected when extracting the path.

* fix wasm run without --release

* LTO off in small profile
2026-03-14 12:13:28 +01:00
Sabin Regmi
9ae85019ad Use fallback cell size when glyphs missing (#942)
Replace unwraps when querying the first glyph with safe handling and provide a fallback monospace cell size if no glyph is available (e.g. on wasm while fonts are still loading). Computes a reasonable width/height from the current font_size (width = 0.6 * font_size, height = font_size) so the editor can render on first draw instead of aborting. Keeps existing cell_size and cell_offset_y calculations based on the chosen dimensions.
2026-03-14 12:13:04 +01:00
Jason Yau
ead4c20cf0 Fix windows build error (#944)
* regenerate windows-rs to export missing functions

* fix compilation errors on windows

* import WS_EX_TOOLWINDOW from windows-rs instead of customizing the constant

---------

Co-authored-by: jasonqiu <jasonqiuchen@outlook.com>
2026-03-14 12:12:50 +01:00