Рабочий прототип
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user