You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in TimelineView.swift
func snapWidth(_ width:CGFloat, max:CGFloat) -> CGFloat {
let n = log2((2 * max) / width)
var intN = trunc(n)
if n - intN >= 0.5 {
intN += 1
}
let result = (2 * max) / (pow(2,intN))
return result
}
in FrameImagesView.swift
func indexWithPosition(_ position:CGFloat) -> Int{
let index = position * CGFloat(thumbnailCountFloat()) / frame.size.width
let indexround = round(index)
let doubleToString = "(indexround)"
let indexInt = (doubleToString as NSString).integerValue
return indexInt
}
The text was updated successfully, but these errors were encountered:
in centerline.swift
func setTimeText() {
let minute = trunc(currentTime / 60)
let second = (currentTime - Float64(minute) * 60)
let truncsec = trunc(second)
let milliSec = Int((second - Float64(truncsec)) * 100)
let text = String(format: "%02d:%02d.%02d", minute, (Int(second)), milliSec)
timeLabel.text = text
}
in swift 4(or 5)
int(double) make runtime errors
I quick fixed below func to avoid runtime error
in TimelineView.swift
func snapWidth(_ width:CGFloat, max:CGFloat) -> CGFloat {
let n = log2((2 * max) / width)
var intN = trunc(n)
if n - intN >= 0.5 {
intN += 1
}
let result = (2 * max) / (pow(2,intN))
return result
}
in FrameImagesView.swift
func indexWithPosition(_ position:CGFloat) -> Int{
let index = position * CGFloat(thumbnailCountFloat()) / frame.size.width
let indexround = round(index)
let doubleToString = "(indexround)"
let indexInt = (doubleToString as NSString).integerValue
return indexInt
}
The text was updated successfully, but these errors were encountered: