Browse Source

Add to `ShapeDynamic` to kb_text_shape_procs.odin

gingerBill 2 months ago
parent
commit
676727114f
1 changed files with 11 additions and 0 deletions
  1. 11 0
      vendor/kb_text_shape/kb_text_shape_procs.odin

+ 11 - 0
vendor/kb_text_shape/kb_text_shape_procs.odin

@@ -149,3 +149,14 @@ PositionGlyph :: proc(Cursor: ^cursor, Glyph: ^glyph) -> (X, Y: i32) {
 	kbts_PositionGlyph(Cursor, Glyph, &X, &Y)
 	return
 }
+
+@(require_results)
+ShapeDynamic :: proc(State: ^shape_state, Config: ^shape_config,
+                     MainDirection, RunDirection: direction,
+                     Glyphs: ^[dynamic]glyph) -> c.int {
+	GlyphCount    := u32(len(Glyphs^))
+	GlyphCapacity := u32(cap(Glyphs^))
+	Res := Shape(State, Config, MainDirection, RunDirection, raw_data(Glyphs^), &GlyphCount, GlyphCapacity)
+	resize(Glyphs, int(GlyphCount))
+	return Res
+}