Skip to content

Commit

Permalink
Fix/bar path adjustment (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
zibs authored Jan 24, 2025
1 parent e406efc commit c77a3a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wild-mayflies-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"victory-native": patch
---

Fix bar group positioning
2 changes: 1 addition & 1 deletion lib/src/cartesian/hooks/useBarPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const useBarPath = (

if (roundedCorners) {
const nonUniformRoundedRect = createRoundedRectPath(
x,
x - barWidth / 2,
y,
barWidth,
barHeight,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/cartesian/hooks/useStackedBarPaths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const useStackedBarPaths = ({

if (roundedCorners) {
const nonUniformRoundedRect = createRoundedRectPath(
x,
x - barWidth / 2,
y - (offset ?? 0),
barWidth,
barHeight,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/createRoundedRectPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const createRoundedRectPath = (

const nonUniformRoundedRect = {
rect: {
x: x - barWidth / 2,
x: x,
y: y,
width: barWidth,
height: barHeight,
Expand Down

0 comments on commit c77a3a1

Please sign in to comment.