From 3f772f525bd98d67b909adaa4299c022a5443905 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 14 Sep 2015 20:35:33 +0200 Subject: [PATCH] Backgrounds: let the preview scale with the font size. --- src/preferences/backgrounds/BackgroundsView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/preferences/backgrounds/BackgroundsView.cpp b/src/preferences/backgrounds/BackgroundsView.cpp index d80a7e0eb6..dc21255413 100644 --- a/src/preferences/backgrounds/BackgroundsView.cpp +++ b/src/preferences/backgrounds/BackgroundsView.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 Haiku, Inc. All rights reserved. + * Copyright 2002-2015 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -12,6 +12,8 @@ #include "BackgroundsView.h" +#include + #include #include @@ -1155,7 +1157,7 @@ Preview::Preview() BControl("PreView", NULL, NULL, B_WILL_DRAW | B_SUBPIXEL_PRECISE) { float aspectRatio = BScreen().Frame().Width() / BScreen().Frame().Height(); - float previewWidth = 120.0f; + float previewWidth = 120.0f * std::max(1.0f, be_plain_font->Size() / 12.0f); float previewHeight = ceil(previewWidth / aspectRatio); ResizeTo(previewWidth, previewHeight);