Skip to main content

ass_renderer/layout/positioning/
mod.rs

1//! Advanced positioning and alignment calculations based on libass
2//!
3//! This module provides positioning calculations that match libass behavior,
4//! including proper anchor point handling, rotation origins, and alignment.
5
6mod coords;
7mod info;
8
9pub use coords::{convert_ssa_alignment, scale_coordinates};
10pub use info::PositionInfo;
11
12/// Bounding box for text
13#[derive(Debug, Clone)]
14pub struct BoundingBox {
15    pub x: f32,
16    pub y: f32,
17    pub width: f32,
18    pub height: f32,
19}
20
21/// Configuration for position calculation
22pub struct PositionConfig {
23    pub screen_width: f32,
24    pub screen_height: f32,
25    pub margin_left: f32,
26    pub margin_right: f32,
27    pub margin_vertical: f32,
28    pub default_alignment: u8,
29}