Skip to content

Commit

Permalink
refactor(pictorial): refactor xor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovilia committed Dec 4, 2024
1 parent 08fb397 commit 5a1be94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chart/bar/PictorialBarView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ function prepareBarLength(

// if 'pxSign' means sign of pixel, it can't be zero, or symbolScale will be zero
// and when borderWidth be settled, the actual linewidth will be NaN
outputSymbolMeta.pxSign = (valueDim.xy === 'x' !== valueAxis.inverse)
const isXAxis = valueDim.xy === 'x';
const isInverse = valueAxis.inverse;
outputSymbolMeta.pxSign = (isXAxis && !isInverse || !isXAxis && isInverse)
? boundingLength >= 0 ? 1 : -1
: boundingLength > 0 ? 1 : -1;
}
Expand Down

0 comments on commit 5a1be94

Please sign in to comment.