Shadow offsets are in device coordinates (pixels).
This commit is contained in:
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include <QGraphicsRectItem>
|
#include <QGraphicsRectItem>
|
||||||
#include <QGraphicsDropShadowEffect>
|
#include <QGraphicsDropShadowEffect>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -29,6 +31,8 @@ namespace
|
|||||||
const QColor paperOutlineColor( 0, 0, 0 );
|
const QColor paperOutlineColor( 0, 0, 0 );
|
||||||
|
|
||||||
const QColor shadowColor( 64, 64, 64 );
|
const QColor shadowColor( 64, 64, 64 );
|
||||||
|
const double shadowOffset = 3;
|
||||||
|
const double shadowRadius = 12;
|
||||||
|
|
||||||
const QColor labelColor( 242, 242, 242 );
|
const QColor labelColor( 242, 242, 242 );
|
||||||
const QColor labelOutlineColor( 64, 64, 64 );
|
const QColor labelOutlineColor( 64, 64, 64 );
|
||||||
@@ -56,6 +60,7 @@ namespace gLabels
|
|||||||
|
|
||||||
if ( tmplate != NULL )
|
if ( tmplate != NULL )
|
||||||
{
|
{
|
||||||
|
// Set scene up with a 5% margin around paper
|
||||||
double x = -0.05 * tmplate->pageWidth();
|
double x = -0.05 * tmplate->pageWidth();
|
||||||
double y = -0.05 * tmplate->pageHeight();
|
double y = -0.05 * tmplate->pageHeight();
|
||||||
double w = 1.10 * tmplate->pageWidth();
|
double w = 1.10 * tmplate->pageWidth();
|
||||||
@@ -84,8 +89,8 @@ namespace gLabels
|
|||||||
{
|
{
|
||||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||||
shadowEffect->setColor( shadowColor );
|
shadowEffect->setColor( shadowColor );
|
||||||
shadowEffect->setOffset( 0.005*pw );
|
shadowEffect->setOffset( shadowOffset );
|
||||||
shadowEffect->setBlurRadius( 0.035*pw );
|
shadowEffect->setBlurRadius( shadowRadius );
|
||||||
|
|
||||||
QBrush brush( paperColor );
|
QBrush brush( paperColor );
|
||||||
QPen pen( paperOutlineColor );
|
QPen pen( paperOutlineColor );
|
||||||
|
|||||||
Reference in New Issue
Block a user