Permalink
Browse files

Round border widths to whole-pixel values before rendering; prevents …

…ugly artifacts when non-px units are used, fixes issue #63.
  • Loading branch information...
1 parent 7728881 commit 6da61531397d96db0cc4560fd0ea85932cfd9c2e Jason Johnston committed Sep 11, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 sources/BorderRenderer.js
@@ -169,6 +169,7 @@ PIE.BorderRenderer = PIE.RendererBase.newRenderer( {
borderInfo = this.styleInfos.borderInfo,
segments = [],
floor, ceil, wT, wR, wB, wL,
+ round = Math.round,
borderProps, radiusInfo, radii, widths, styles, colors;
if( borderInfo.isActive() ) {
@@ -197,10 +198,10 @@ PIE.BorderRenderer = PIE.RendererBase.newRenderer( {
elW = bounds.w;
elH = bounds.h;
- wT = widths['t'].pixels( el );
- wR = widths['r'].pixels( el );
- wB = widths['b'].pixels( el );
- wL = widths['l'].pixels( el );
+ wT = round( widths['t'].pixels( el ) );
+ wR = round( widths['r'].pixels( el ) );
+ wB = round( widths['b'].pixels( el ) );
+ wL = round( widths['l'].pixels( el ) );
var pxWidths = {
't': wT,
'r': wR,

0 comments on commit 6da6153

Please sign in to comment.