Skip to content

Commit

Permalink
Fix exception for font size <= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirill Gerasimenko committed Oct 18, 2016
1 parent 9962d59 commit 92ca218
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion FsEye/Forms/WatchTreeView.fs
Expand Up @@ -295,7 +295,10 @@ type WatchTreeView(pluginManager: PluginManager option) as this =
|> Event.map (fun args -> if args.Delta > 0 then 1.0f else -1.0f)
|> Event.add (fun fontSizeDelta ->
let oldFont = this.Font
let newFont = Font (oldFont.FontFamily, oldFont.Size + fontSizeDelta, oldFont.Style)
let newSize =
let s = oldFont.Size + fontSizeDelta
if s <= 0.0f then 1.0f else s
let newFont = Font (oldFont.FontFamily, newSize, oldFont.Style)
this.Font <- newFont
oldFont.Dispose ())
with
Expand Down

0 comments on commit 92ca218

Please sign in to comment.