commit d0ee3ac

shrub  ·  2026-04-29 17:30:41 +0000 UTC
parent 9874689
comments
1 files changed,  +8, -0
+8, -0
 1@@ -41,6 +41,7 @@ decor_title_length(struct wld_font *font, const char *title, uint32_t max_width)
 2 	while (title[len]) {
 3 		uint32_t next = len + 1;
 4 
 5+		/* we skip utf-8 continuation bytes */
 6 		while ((title[next] & 0xc0) == 0x80) {
 7 			next++;
 8 		}
 9@@ -262,6 +263,9 @@ close_decor_string(struct compositor_view *view)
10 	view->decor.string = NULL;
11 }
12 
13+/* draw decor part by tiling it across the target region.
14+ * the part buffer is repeated to fill the entirety of some width x height area,
15+ * but only damaged regions are actually rendred*/
16 static void
17 draw_decor_part(struct wld_renderer *renderer,
18                 const struct swc_rectangle *target_geom,
19@@ -450,6 +454,10 @@ decor_repaint(struct wld_renderer *renderer,
20 		return;
21 	}
22 
23+	/* calculate text position based on which edge
24+	 * the decor is on. base_x base_y is the top-left corner,
25+	 * max_width is available space
26+	 * decor_size is perpendicular dimension of the edge where text is being drawn */
27 	switch (text->edge) {
28 	case SWC_DECOR_EDGE_TOP:
29 		if (!view->decor.top) {