From fe87cd5d761b99cdfd9e7828c793eb444ce14de2 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Sat, 16 Nov 2013 15:50:05 -0500 Subject: [PATCH] Shadow offsets are in device coordinates (pixels). --- app/SimplePreview.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/SimplePreview.cpp b/app/SimplePreview.cpp index 17d19f2..714b0db 100644 --- a/app/SimplePreview.cpp +++ b/app/SimplePreview.cpp @@ -22,6 +22,8 @@ #include #include +#include + namespace { @@ -29,6 +31,8 @@ namespace const QColor paperOutlineColor( 0, 0, 0 ); const QColor shadowColor( 64, 64, 64 ); + const double shadowOffset = 3; + const double shadowRadius = 12; const QColor labelColor( 242, 242, 242 ); const QColor labelOutlineColor( 64, 64, 64 ); @@ -56,6 +60,7 @@ namespace gLabels if ( tmplate != NULL ) { + // Set scene up with a 5% margin around paper double x = -0.05 * tmplate->pageWidth(); double y = -0.05 * tmplate->pageHeight(); double w = 1.10 * tmplate->pageWidth(); @@ -84,8 +89,8 @@ namespace gLabels { QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect(); shadowEffect->setColor( shadowColor ); - shadowEffect->setOffset( 0.005*pw ); - shadowEffect->setBlurRadius( 0.035*pw ); + shadowEffect->setOffset( shadowOffset ); + shadowEffect->setBlurRadius( shadowRadius ); QBrush brush( paperColor ); QPen pen( paperOutlineColor );