mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-04 13:30:48 +00:00
Respect 'Clip' on Artboards when exporting "All Artworks". (#1916)
* Add constraint_bounds function to Quad implementation * Respect Clip property when exporting All Artworks and centering document using the ctrl + 0 hotkey. Calculate artboard_clip_bounds and then constraint the all_layer_bounds to respect the bounds of the Clipped Artboards. * Use parent_artboard to find ancestor artboards of each layer and constrain bounds if artboard is clipped * Remove redundant comments
This commit is contained in:
parent
193f757c45
commit
1b6d45ad30
2 changed files with 34 additions and 1 deletions
|
@ -49,6 +49,14 @@ impl Quad {
|
|||
[a[0].min(b[0]), a[1].max(b[1])]
|
||||
}
|
||||
|
||||
/// "Clip" bounds of 'a' to the limits of 'b'
|
||||
pub fn constraint_bounds(a: [DVec2; 2], b: [DVec2; 2]) -> [DVec2; 2] {
|
||||
[
|
||||
a[0].max(b[0]), // Constrain min corner
|
||||
a[1].min(b[1]), // Constrain max corner
|
||||
]
|
||||
}
|
||||
|
||||
/// Expand a quad by a certain amount on all sides.
|
||||
///
|
||||
/// Not currently very optimised
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue