Skip to content

Commit

Permalink
DPI変換にPt単位を使う
Browse files Browse the repository at this point in the history
固定値16ptをlfHeightと直接比較するのをやめ、DPI変換した値で比較する。lfHeightの値は既にDPI変換されているので修正箇所は16ptのほうだけ。
  • Loading branch information
berryzplus committed Nov 24, 2018
1 parent 2c79f07 commit 13f0991
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sakura_core/prop/CPropCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ HFONT CPropCommon::SetFontLabel( HWND hwndDlg, int idc_static, const LOGFONT& lf
lfTemp = lf;

// 大きすぎるフォントは小さく表示
int limitSize = DpiScaleY( 16 );
LONG limitSize = ::DpiPointsToPixels( 16 );
if ( lfTemp.lfHeight < -limitSize ) {
lfTemp.lfHeight = -limitSize;
}
Expand Down
2 changes: 1 addition & 1 deletion sakura_core/typeprop/CPropTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ HFONT CPropTypes::SetFontLabel( HWND hwndDlg, int idc_static, const LOGFONT& lf,
lfTemp = lf;

// 大きすぎるフォントは小さく表示
int limitSize = DpiScaleY( 16 );
LONG limitSize = ::DpiPointsToPixels( 16 );
if ( lfTemp.lfHeight < -limitSize ) {
lfTemp.lfHeight = -limitSize;
}
Expand Down

0 comments on commit 13f0991

Please sign in to comment.