2022-11-20 03:45:42 +11:00
|
|
|
// SPDX-License-Identifier: Apache-2.0 OR MIT OR Unlicense
|
2022-10-27 07:55:45 +11:00
|
|
|
|
|
|
|
// The annotated bounding box for a path. It has been transformed,
|
|
|
|
// but contains a link to the active transform, mostly for gradients.
|
2022-11-04 10:53:34 +11:00
|
|
|
// Coordinates are integer pixels (for the convenience of atomic update)
|
|
|
|
// but will probably become fixed-point fractions for rectangles.
|
2022-10-27 07:55:45 +11:00
|
|
|
struct PathBbox {
|
2022-11-04 10:53:34 +11:00
|
|
|
x0: i32,
|
|
|
|
y0: i32,
|
|
|
|
x1: i32,
|
|
|
|
y1: i32,
|
2022-10-27 07:55:45 +11:00
|
|
|
linewidth: f32,
|
|
|
|
trans_ix: u32,
|
|
|
|
}
|
|
|
|
|
2022-10-29 06:01:15 +11:00
|
|
|
fn bbox_intersect(a: vec4<f32>, b: vec4<f32>) -> vec4<f32> {
|
|
|
|
return vec4(max(a.xy, b.xy), min(a.zw, b.zw));
|
2022-10-27 07:55:45 +11:00
|
|
|
}
|