Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sakura.iniがない状態で起動した時にマウスホイールでフォントサイズが変更できない問題を修正 #1536

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sakura_core/cmd/CViewCommander_Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,14 @@ void CViewCommander::Command_SETFONTSIZE( int fontSize, int shift, int mode )
nCurrentZoom = 1.0;
}else if( 0 != shift ){
// 現在のフォントに対して、縮小or拡大したフォント選択する場合
double nBasePointSizeF = nOriginalPointSize;
if( nBasePointSizeF == 0.0 ){
// 基準値が無効値の時はLOGFONTのサイズから逆算
const LOGFONT& lfBase = (mode == 0) ? GetDllShareData().m_Common.m_sView.m_lf : GetEditWindow()->GetLogfont( false );
nBasePointSizeF = (lfBase.lfHeight != 0) ? (std::abs( DpiPixelsToPoints( lfBase.lfHeight ) ) * 10.0) : nPointSizeMin;
}
double nPointSizeF = 0.0;
if( !GetZoomedValue( zoomSetting, nOriginalPointSize, nCurrentZoom, shift, &nPointSizeF, &nCurrentZoom ) ){
if( !GetZoomedValue( zoomSetting, nBasePointSizeF, nCurrentZoom, shift, &nPointSizeF, &nCurrentZoom ) ){
return;
}
nPointSize = (int)nPointSizeF;
Expand Down
2 changes: 2 additions & 0 deletions tests/unittests/test-winmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ TEST_F( WinMainTest, runEditorProcess )
strStartupMacro += L"ShowTab();"; //ShowTab 消す
strStartupMacro += L"ExpandParameter('$I');"; // INIファイルパスの取得(呼ぶだけ)
// フォントサイズ設定のテスト(ここから)
strStartupMacro += L"SetFontSize(0, 1, 0);"; // 相対指定 - 拡大 - 対象:共通設定
strStartupMacro += L"SetFontSize(0, -1, 0);"; // 相対指定 - 縮小 - 対象:共通設定
strStartupMacro += L"SetFontSize(100, 0, 0);"; // 直接指定 - 対象:共通設定
strStartupMacro += L"SetFontSize(100, 0, 1);"; // 直接指定 - 対象:タイプ別設定
strStartupMacro += L"SetFontSize(100, 0, 2);"; // 直接指定 - 対象:一時適用
Expand Down