RichEdit: zooming

git-svn-id: svn://ultimatepp.org/upp/trunk@11921 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2018-04-30 20:19:01 +00:00
commit 408157313b
7 changed files with 45 additions and 13 deletions

View file

@ -18,9 +18,13 @@ void RichEdit::CancelMode()
void RichEdit::MouseWheel(Point p, int zdelta, dword keyflags)
{
if(keyflags == K_CTRL && !IsNull(floating_zoom)) {
floating_zoom = minmax(floating_zoom + zdelta / 480.0, 0.5, 10.0);
RefreshLayoutDeep();
if(keyflags == K_CTRL) {
if(IsNull(floating_zoom))
ZoomView(sgn(zdelta));
else {
floating_zoom = minmax(floating_zoom + zdelta / 480.0, 0.5, 10.0);
RefreshLayoutDeep();
}
}
else
sb.Wheel(zdelta);