Рабочий прототип

This commit is contained in:
2025-11-17 22:46:36 +03:00
parent 494686a203
commit f48bc757ea
4 changed files with 299 additions and 109 deletions

View File

@@ -16,9 +16,15 @@ void figure_draw(struct window_draw_info* draw_info, float border_thickness, uin
struct figure_animation_info fig = draw_info->figure;
/* center in pixels */
float cx = fig.position.x * (float)w;
float cy = fig.position.y * (float)h;
/* Calculate aspect ratio: width is proportional, height is always 1.0 */
float aspect_ratio = (float)w / (float)h;
/* center in pixels:
* x coordinates are in range [0, aspect_ratio]
* y coordinates are in range [0, 1.0]
*/
float cx = fig.position.x * (float)h; /* scale x by height to maintain aspect */
float cy = fig.position.y * (float)h; /* scale y by height */
/* `fig.radius` is in pixels now; use it directly. */
float r = fig.radius;
float r2 = r * r;