Skip to content

Commit

Permalink
support zero
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleduo committed Sep 25, 2019
1 parent f5abb79 commit 58ec2ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/tinypng4mac/views/TaskTableCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ class TaskTableCell: NSTableCellView {
}

if taskStatus == .finish {
let text = "-\(Formator.formatSize(task!.originSize - task!.resultSize)) (\(Formator.formatRate(1 - task!.compressRate)))"
let sizeChange = task!.originSize - task!.resultSize
var text: String = ""
if sizeChange == 0 {
text = "0.00B"
} else {
text = "-\(Formator.formatSize(sizeChange)) (\(Formator.formatRate(1 - task!.compressRate)))"
}
self.status.stringValue = text
self.status.textColor = NSColor(deviceRed:0.41, green:0.95, blue:0.78, alpha:1.00)
self.name.textColor = NSColor(deviceRed:1, green:1, blue:1, alpha:0.9)
Expand Down

0 comments on commit 58ec2ce

Please sign in to comment.