aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assets/button/tool_buttons.pngbin24125 -> 24760 bytes
-rw-r--r--assets/button/tool_buttons.xcfbin53024 -> 87131 bytes
-rw-r--r--src/math/polygon/mod.rs2
-rw-r--r--src/tool/polygon_room_tool.rs5
4 files changed, 3 insertions, 4 deletions
diff --git a/assets/button/tool_buttons.png b/assets/button/tool_buttons.png
index 2a6a214..1a9d74b 100644
--- a/assets/button/tool_buttons.png
+++ b/assets/button/tool_buttons.png
Binary files differ
diff --git a/assets/button/tool_buttons.xcf b/assets/button/tool_buttons.xcf
index 9cd012b..e01bf92 100644
--- a/assets/button/tool_buttons.xcf
+++ b/assets/button/tool_buttons.xcf
Binary files differ
diff --git a/src/math/polygon/mod.rs b/src/math/polygon/mod.rs
index e1f15c5..ed48751 100644
--- a/src/math/polygon/mod.rs
+++ b/src/math/polygon/mod.rs
@@ -367,7 +367,7 @@ impl<
* after another until finally connecting the last point to the first point in radians. Negative,
* when the points in sum are right-turning, positive, when they are left-turning.
*/
-fn combined_angle<T: Scalar + Copy + RealField>(points: &Vec<Vec2<T>>) -> T {
+fn combined_angle<T: Scalar + Copy + RealField>(points: &[Vec2<T>]) -> T {
let mut combined_angle = T::zero();
for i in 0..points.len() {
let prev = (i + points.len() - 1) % points.len();
diff --git a/src/tool/polygon_room_tool.rs b/src/tool/polygon_room_tool.rs
index 58f326f..42874e8 100644
--- a/src/tool/polygon_room_tool.rs
+++ b/src/tool/polygon_room_tool.rs
@@ -33,9 +33,8 @@ impl UnfinishedPolygon {
// TODO: Is this possible without changing the mutability of self and without reallocation?
let mut corners = self.corners.clone();
corners.push(self.working_corner);
- let res = Polygon::check_validity(&corners);
- res
+ Polygon::check_validity(&corners)
}
pub fn try_into_completed(&mut self) -> Option<Polygon<f32>> {
@@ -65,7 +64,7 @@ impl UnfinishedPolygon {
}
pub fn try_push_working(&mut self) -> Result<(), PolygonError<f32>> {
- assert!(self.corners.len() >= 1);
+ assert!(!self.corners.is_empty());
if self.corners.len() == 1 {
return if self.corners[0] != self.working_corner {