reflexion 0.1.48 → 0.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog.md +5 -0
- data/VERSION +1 -1
- data/src/shape.cpp +18 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e490c3d3e75c2e07cd82f02772eb87b45729bd4dbf7444a01e82e631e2673a33
|
4
|
+
data.tar.gz: e52a6698bcc86a4509799637efc4019e76c39eecc5122a9a565455f18b7691e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 761419026cc6c7f939d714d67ee47c3d3798a7128666deb6100e470e5e80b0a17ead5747270ca33125bbf0338a39e27c9fa1810e13bde7182cc69e6d3bb12ef7
|
7
|
+
data.tar.gz: 4f6900e7f5279eceb728e4e003eae016e68af385bc9a6e9c88ca02d67ab22fe538ad2dd5565e4b177689b1392f01c928bff101d22322bd275446a74f31d9d1e0
|
data/ChangeLog.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.49
|
data/src/shape.cpp
CHANGED
@@ -795,28 +795,28 @@ namespace Reflex
|
|
795
795
|
|
796
796
|
Fixture* create_fixtures (Shape* shape) override
|
797
797
|
{
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
return
|
798
|
+
Bounds frame = get_frame();
|
799
|
+
bool rect = frame.size() != 0;
|
800
|
+
if (rect && !has_rounds())
|
801
|
+
return create_rect_fixture(shape, frame);
|
802
|
+
else if (rect && nsegment <= 1)
|
803
|
+
return create_rect_fixture_without_division(shape, frame);
|
802
804
|
else
|
803
805
|
return Super::create_fixtures(shape);
|
804
806
|
}
|
805
807
|
|
806
|
-
Fixture* create_rect_fixture (Shape* shape)
|
808
|
+
Fixture* create_rect_fixture (Shape* shape, const Bounds& frame)
|
807
809
|
{
|
808
810
|
assert(shape);
|
809
811
|
|
810
812
|
if (!owner)
|
811
813
|
invalid_state_error(__FILE__, __LINE__);
|
812
814
|
|
813
|
-
Bounds f = get_frame();
|
814
815
|
float ppm = owner->meter2pixel();
|
815
|
-
|
816
|
-
coord
|
817
|
-
coord
|
818
|
-
coord
|
819
|
-
coord b = to_b2coord(f.x + f.h, ppm);
|
816
|
+
coord l = to_b2coord(frame.x, ppm);
|
817
|
+
coord t = to_b2coord(frame.y, ppm);
|
818
|
+
coord r = to_b2coord(frame.x + frame.w, ppm);
|
819
|
+
coord b = to_b2coord(frame.x + frame.h, ppm);
|
820
820
|
b2Vec2 b2points[] = {{l, t}, {l, b}, {r, b}, {r, t}};
|
821
821
|
|
822
822
|
b2PolygonShape b2shape;
|
@@ -825,23 +825,22 @@ namespace Reflex
|
|
825
825
|
return FixtureBuilder(shape, &b2shape).fixtures();
|
826
826
|
}
|
827
827
|
|
828
|
-
Fixture* create_rect_fixture_without_division (
|
828
|
+
Fixture* create_rect_fixture_without_division (
|
829
|
+
Shape* shape, const Bounds& frame)
|
829
830
|
{
|
830
831
|
assert(shape);
|
831
832
|
|
832
833
|
if (!owner)
|
833
834
|
invalid_state_error(__FILE__, __LINE__);
|
834
835
|
|
835
|
-
Bounds f = get_frame();
|
836
|
-
float ppm = owner->meter2pixel();
|
837
|
-
|
838
836
|
Polygon polygon = Rays::create_rect(
|
839
|
-
|
837
|
+
frame.x, frame.y, frame.width, frame.height,
|
840
838
|
round_left_top, round_right_top,
|
841
839
|
round_left_bottom, round_right_bottom,
|
842
840
|
1);
|
843
841
|
assert(polygon.size() == 1);
|
844
842
|
|
843
|
+
float ppm = owner->meter2pixel();
|
845
844
|
const Polyline& polyline = polygon[0];
|
846
845
|
assert(polyline[0].size() <= 8);
|
847
846
|
|
@@ -1030,10 +1029,10 @@ namespace Reflex
|
|
1030
1029
|
|
1031
1030
|
Fixture* create_fixtures (Shape* shape) override
|
1032
1031
|
{
|
1033
|
-
Bounds
|
1034
|
-
bool circle
|
1032
|
+
Bounds frame = get_frame();
|
1033
|
+
bool circle = frame.size() != 0 && frame.width == frame.height;
|
1035
1034
|
if (circle && !has_angle() && !has_hole() && has_fill(shape))
|
1036
|
-
return create_circle_fixture(shape,
|
1035
|
+
return create_circle_fixture(shape, frame);
|
1037
1036
|
else
|
1038
1037
|
return Super::create_fixtures(shape);
|
1039
1038
|
}
|