File tree Expand file tree Collapse file tree 6 files changed +26
-11
lines changed Expand file tree Collapse file tree 6 files changed +26
-11
lines changed Original file line number Diff line number Diff line change
1
+ ## [ 0.5.30] ( https://github.com/nicklockwood/Euclid/releases/tag/0.5.30 ) (2022-09-26)
2
+
3
+ - Fixed bug where applying negative scale to bounds made it empty
4
+
1
5
## [ 0.5.29] ( https://github.com/nicklockwood/Euclid/releases/tag/0.5.29 ) (2022-09-03)
2
6
3
7
- Fixed bug where transforming an empty bounds led to nan coordinates
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " Euclid" ,
3
- "version" : " 0.5.29 " ,
3
+ "version" : " 0.5.30 " ,
4
4
"license" : {
5
5
"type" : " MIT" ,
6
6
"file" : " LICENSE.md"
10
10
"authors" : " Nick Lockwood" ,
11
11
"source" : {
12
12
"git" : " https://github.com/nicklockwood/Euclid.git" ,
13
- "tag" : " 0.5.29 "
13
+ "tag" : " 0.5.30 "
14
14
},
15
15
"source_files" : " Sources" ,
16
16
"requires_arc" : true ,
Original file line number Diff line number Diff line change 634
634
ONLY_ACTIVE_ARCH = YES;
635
635
SDKROOT = macosx;
636
636
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
637
- SWIFT_OPTIMIZATION_LEVEL = "-O ";
637
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone ";
638
638
SWIFT_VERSION = 4.2;
639
639
VERSIONING_SYSTEM = "apple-generic";
640
640
VERSION_INFO_PREFIX = "";
722
722
"@executable_path/../Frameworks",
723
723
"@loader_path/Frameworks",
724
724
);
725
- MARKETING_VERSION = 0.5.29 ;
725
+ MARKETING_VERSION = 0.5.30 ;
726
726
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=75";
727
727
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.Euclid;
728
728
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
755
755
"@executable_path/../Frameworks",
756
756
"@loader_path/Frameworks",
757
757
);
758
- MARKETING_VERSION = 0.5.29 ;
758
+ MARKETING_VERSION = 0.5.30 ;
759
759
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=75";
760
760
PRODUCT_BUNDLE_IDENTIFIER = com.charcoaldesign.Euclid;
761
761
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
Original file line number Diff line number Diff line change @@ -715,17 +715,14 @@ public extension Bounds {
715
715
/// - Parameter v: A scale vector to apply to the bounds.
716
716
func scaled( by v: Vector ) -> Bounds {
717
717
let v = v. clamped ( )
718
- return isEmpty ? self : Bounds (
719
- min: min. scaled ( by: v) ,
720
- max: max. scaled ( by: v)
721
- )
718
+ return isEmpty ? self : Bounds ( min. scaled ( by: v) , max. scaled ( by: v) )
722
719
}
723
720
724
721
/// Returns a scaled copy of the bounds.
725
722
/// - Parameter f: A scale factor to apply to the bounds.
726
723
func scaled( by f: Double ) -> Bounds {
727
724
let f = f. clamped ( )
728
- return isEmpty ? self : Bounds ( min: min * f, max : max * f)
725
+ return isEmpty ? self : Bounds ( min * f, max * f)
729
726
}
730
727
731
728
/// Returns a transformed copy of the bounds.
Original file line number Diff line number Diff line change @@ -329,4 +329,18 @@ class TransformTests: XCTestCase {
329
329
)
330
330
XCTAssertNotNil ( mesh. transformed ( by: transform) . boundsIfSet)
331
331
}
332
+
333
+ // MARK: Bounds transforms
334
+
335
+ func testBoundsInvertedScale( ) {
336
+ let bounds = Bounds ( min: - . one, max: . one)
337
+ let transform = Transform ( scale: - . one)
338
+ XCTAssertEqual ( bounds. transformed ( by: transform) , bounds)
339
+ }
340
+
341
+ func testBoundsInvertedScale2( ) {
342
+ let bounds = Bounds ( min: - . one, max: . one)
343
+ let transform = Transform ( scale: - Vector( - 1 , 1 , 1 ) )
344
+ XCTAssertEqual ( bounds. transformed ( by: transform) , bounds)
345
+ }
332
346
}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ let package = Package(
14
14
dependencies: [
15
15
. package (
16
16
url: " https://github.com/nicklockwood/Euclid.git " ,
17
- . upToNextMinor( from: " 0.5.29 " )
17
+ . upToNextMinor( from: " 0.5.30 " )
18
18
) ,
19
19
. package (
20
20
url: " https://github.com/nicklockwood/LRUCache.git " ,
You can’t perform that action at this time.
0 commit comments