Skip to content

Commit

Permalink
current font scaling!
Browse files Browse the repository at this point in the history
  • Loading branch information
wavewave committed Sep 22, 2023
1 parent de04e73 commit 2fc1794
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions daemon/app/ghc-specter-daemon/Util/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ renderShape (SPolyline (Polyline xy0 xys xy1 color swidth)) = ImRender $ do
renderShape (SDrawText (DrawText (x, y) pos font color fontSize msg)) = ImRender $ do
s <- ask
liftIO $ do
let (selected_font_size, selected_font) =
case font of
Sans -> pickNearestFont s.currSharedState.sharedFontsSans (fromIntegral fontSize)
Mono -> pickNearestFont s.currSharedState.sharedFontsMono (fromIntegral fontSize)
let (_, sy) = s.currScale
(selected_font_size, selected_font) =
case font of
Sans -> pickNearestFont s.currSharedState.sharedFontsSans (fromIntegral fontSize * sy)
Mono -> pickNearestFont s.currSharedState.sharedFontsMono (fromIntegral fontSize * sy)
scale_factor = s.currSharedState.sharedFontScaleFactor
factor = (fromIntegral fontSize) * sy * scale_factor / fromIntegral selected_font_size
imFont_Scale_set selected_font (realToFrac factor)
Expand Down

0 comments on commit 2fc1794

Please sign in to comment.