Skip to content

Commit

Permalink
Fixed translation offset did not work on StackFrameLayout and DoubleF…
Browse files Browse the repository at this point in the history
…rameLayout
  • Loading branch information
kennic committed Sep 30, 2023
1 parent ccb3527 commit 7c483e5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Binary file not shown.
2 changes: 1 addition & 1 deletion FrameLayoutKit.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'FrameLayoutKit'
s.version = '7.0.3'
s.version = '7.0.4'
s.summary = 'FrameLayoutKit is a super fast and easy to use layout kit'
s.description = <<-DESC
FrameLayoutKit is a powerful Swift library designed to streamline the process of creating user interfaces. With its intuitive operator syntax and support for nested functions, developers can effortlessly construct complex UI layouts with minimal code. By leveraging the flexibility of operators, developers can easily position and arrange views within a container view, enabling precise control over the visual hierarchy. Additionally, the library offers a range of convenient functions for configuring view properties, such as setting dimensions, margins, and alignment. Whether you're building a simple screen or a complex interface, FrameLayoutKit simplifies the UI creation process, resulting in cleaner, more maintainable code.
Expand Down
3 changes: 3 additions & 0 deletions FrameLayoutKit/Classes/DoubleFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,9 @@ open class DoubleFrameLayout: FrameLayout {
}
}

targetFrame1 = targetFrame1.offsetBy(dx: translationOffset.x, dy: translationOffset.y)
targetFrame2 = targetFrame2.offsetBy(dx: translationOffset.x, dy: translationOffset.y)

frameLayout1.frame = targetFrame1.integral
frameLayout2.frame = targetFrame2.integral
}
Expand Down
6 changes: 6 additions & 0 deletions FrameLayoutKit/Classes/StackFrameLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,12 @@ open class StackFrameLayout: FrameLayout {
break
}
}

if translationX != 0 || translationY != 0 {
frameLayouts.forEach {
$0.frame = $0.frame.offsetBy(dx: translationOffset.x, dy: translationOffset.y)
}
}
}

}
Expand Down

0 comments on commit 7c483e5

Please sign in to comment.