Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bradhowes committed Dec 3, 2023
1 parent 7de7088 commit a418b64
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state" : {
"revision" : "bb0ea08db8e73324fe6c3727f755ca41a23ff2f4",
"version" : "1.14.2"
"revision" : "59b663f68e69f27a87b45de48cb63264b8194605",
"version" : "1.15.1"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax.git",
"state" : {
"revision" : "ffa3cd6fc2aa62adbedd31d3efaf7c0d86a9f029",
"version" : "509.0.1"
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036",
"version" : "509.0.2"
}
}
],
Expand Down
4 changes: 1 addition & 3 deletions Sources/Knob-iOS/Knob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ open class Knob: UIControl {

/// The distance in pixels used for calculating mouse/touch changes to the knob value. By default, use the smaller of
/// the view's width and height.
open var travelDistance: CGFloat { (min(bounds.height, bounds.width)) }
open var travelDistance: CGFloat { min(bounds.height, bounds.width) }

/// How much travel is need to change the knob from `minimumValue` to `maximumValue`.
/// By default this is 1x the `travelDistance` value. Setting it to 2 will require 2x the `travelDistance` to go from
Expand Down Expand Up @@ -345,8 +345,6 @@ extension Knob {
// - otherwise, it linearly gets smaller as X moves away from the center
//
let scaleT = dX <= maxChangeRegionWidthHalf ? 1.0 : (1.0 - dX / halfTravelDistance)
print(dX, scaleT)

let deltaT = Float((dY * scaleT) / (travelDistance * touchSensitivity))
let change = deltaT * (maximumValue - minimumValue)
self.value += change
Expand Down

0 comments on commit a418b64

Please sign in to comment.