Skip to content

Commit

Permalink
fix: respect x2Offset for timeUnit band #8955
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed Jun 20, 2023
1 parent 8b1f9af commit cdc5679
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compile/mark/encode/offset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export function positionOffset({
}

const markDefOffsetValue = markDef[channel];
if (markDefOffsetValue) {
if (markDefOffsetValue !== undefined) {
return {offsetType: 'visual', offset: markDefOffsetValue};
}

Expand Down
3 changes: 2 additions & 1 deletion src/compile/mark/encode/position-rect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ function rectBinPosition({
const vgChannel2 = getVgPositionChannel(channel2);

const {offset} = positionOffset({channel, markDef, encoding, model, bandPosition: 0});
const {offset: offset2} = positionOffset({channel: channel2, markDef, encoding, model, bandPosition: 0});

const bandPosition = isSignalRef(bandSize)
? {signal: `(1-${bandSize.signal})/2`}
Expand All @@ -315,7 +316,7 @@ function rectBinPosition({
fieldDef,
scaleName,
bandPosition,
offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset)
offset: getBinSpacing(channel2, spacing, reverse, axisTranslate, offset2 ?? offset)
}),
[vgChannel]: rectBinRef({
fieldDef,
Expand Down

0 comments on commit cdc5679

Please sign in to comment.