gioser

tawasuyu/taffy

A high performance rust-powered UI layout library

HTML 231Rust 8TOML 3CSS 1317 Sutichaykuna

Minor: reordered constrcutor aguments in Rect<T>::map() (#430)

Mostly everywhere, for constructing Rect<T> used the next arguments order:
[left, right, top, bottom], so it looks strange, why here was [top, bottom, left, right]. It's fixed for consistency and to not confuse anyone.

Co-authored-by: Nico Burns <nico@nicoburns.com>

77a309162f0011d9ddb563f435f3cbafc5b1775f · ruwaq Yurii Nakonechnyi · (3 wata ñawpaq) · tayta e997fa3f4 · kay commitpi sach'ata qhaway

Semántico sayk'uy · 1

src/geometry.rs

  • ukhunpi t'ikrakurqan fn map pub

1 qillqakuna · +1 −1

diff --git a/src/geometry.rs b/src/geometry.rs
index e0ebad338..daf6f9570 100644
--- a/src/geometry.rs
+++ b/src/geometry.rs
@@ -74,7 +74,7 @@ impl<T> Rect<T> {
     where
         F: Fn(T) -> R,
     {
-        Rect { top: f(self.top), bottom: f(self.bottom), left: f(self.left), right: f(self.right) }
+        Rect { left: f(self.left), right: f(self.right), top: f(self.top), bottom: f(self.bottom) }
     }
 
     /// Returns a `Line<T>` representing the left and right properties of the Rect