Differentiate between scale and dimensions (#570)

* Differentiate between scale and dimensions

* Fix layout and naming of properties
This commit is contained in:
TrueDoctor
2022-03-27 01:48:40 +01:00
committed by Keavon Chambers
parent 9ced465150
commit 0ee492a857
6 changed files with 114 additions and 52 deletions
@@ -81,7 +81,7 @@ impl Default for GradientToolFsmState {
/// Computes the transform from gradient space to layer space (where gradient space is 0..1 in layer space)
fn gradient_space_transform(path: &[LayerId], layer: &Layer, document: &DocumentMessageHandler) -> DAffine2 {
let bounds = layer.current_bounding_box().unwrap();
let bounds = layer.aabounding_box().unwrap();
let bound_transform = DAffine2::from_scale_angle_translation(bounds[1] - bounds[0], 0., bounds[0]);
document.graphene_document.multiply_transforms(&path[..path.len() - 1]).unwrap() * bound_transform
+1 -1
View File
@@ -166,7 +166,7 @@ fn update_overlays(document: &DocumentMessageHandler, data: &mut TextToolData, r
.graphene_document
.layer(layer_path)
.unwrap()
.current_bounding_box_with_transform(document.graphene_document.multiply_transforms(layer_path).unwrap())
.aabounding_box_for_transform(document.graphene_document.multiply_transforms(layer_path).unwrap())
.unwrap();
let operation = Operation::SetLayerTransformInViewport {