Skip to content

Commit ed98805

Browse files
committed
Fix for disappearing and inaccurate buffer previews in adv labeling
1 parent 47f5c52 commit ed98805

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/app/qgslabelpreview.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ void QgsLabelPreview::paintEvent( QPaintEvent *e )
4848
p.setFont( font() );
4949
QFontMetrics fm( font() );
5050

51+
// otherwise thin buffers don't look like those on canvas
52+
if ( mBufferSize != 0 && mBufferSize < 1 )
53+
mBufferSize = 1;
54+
5155
double xtrans = 0;
5256
if ( mBufferSize != 0 )
5357
xtrans = mBufferSize / 4;

src/app/qgslabelpreview.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class QgsLabelPreview : public QLabel
3232
void paintEvent( QPaintEvent* e );
3333

3434
private:
35-
int mBufferSize;
35+
double mBufferSize;
3636
QColor mBufferColor;
3737
Qt::PenJoinStyle mBufferJoinStyle;
3838
bool mBufferNoFill;

0 commit comments

Comments
 (0)