This repository was archived by the owner on Jun 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Samples/PagingLayoutSamples/Modules/LayoutDesigner Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -134,12 +134,12 @@ private extension SnapshotContainerView {
134
134
y: translateY)
135
135
. scaledBy ( x: scale, y: scale)
136
136
var sizeRatioRow = options. pieceSizeRatio. height
137
- if sizeRatioRow == 0 {
138
- sizeRatioRow = 1
137
+ if abs ( sizeRatioRow) < 0.01 {
138
+ sizeRatioRow = 0.01
139
139
}
140
140
var sizeRatioColumn = options. pieceSizeRatio. width
141
- if sizeRatioColumn == 0 {
142
- sizeRatioColumn = 1
141
+ if abs ( sizeRatioColumn) < 0.01 {
142
+ sizeRatioColumn = 0.01
143
143
}
144
144
let rowCount = Int ( 1.0 / sizeRatioRow)
145
145
let columnCount = Int ( 1.0 / sizeRatioColumn)
Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ class LayoutDesignerViewModel {
157
157
let update : ( ( inout SnapshotTransformViewOptions ) -> Void ) -> Void = { [ weak self] in
158
158
self ? . update ( options: & options, closure: $0)
159
159
}
160
+ optionViewModels = [
161
+ . init( title: " Piece size ratio " , kind: . doubleSlider( current: options. pieceSizeRatio. pair) { n in
162
+ update { $0. pieceSizeRatio = . by( pair: n) }
163
+ } )
164
+ ]
160
165
}
161
166
}
162
167
You can’t perform that action at this time.
0 commit comments