Skip to content

Commit

Permalink
fix: do not round offset anymore
Browse files Browse the repository at this point in the history
This change is to stop rounding the offset, in order to remove any large step changes at the boundaries whenever we're zoomed out (e.g. 1.0 suddenly changing to 2.0).

Please see the before and after results in the attached images. The before is from my machine. The after is from the storybook on github.

![pre_change_ongithubwebsite](https://user-images.githubusercontent.com/1366642/125308865-4493b200-e2ff-11eb-86e6-4f78e2fd1633.png)

![post_change_onmymachine](https://user-images.githubusercontent.com/1366642/125308855-43628500-e2ff-11eb-9910-f85cae3f3123.png)
  • Loading branch information
dev-nll authored and markmcdowell committed Jul 12, 2021
1 parent 308d3a6 commit 2dc53ee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/series/src/CandlestickSeries.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ export class CandlestickSeries extends React.Component<CandlestickSeriesProps> {
plotData,
});

const trueOffset = 0.5 * width;
const offset = trueOffset > 0.7 ? Math.round(trueOffset) : Math.floor(trueOffset);
const offset = 0.5 * width;

return plotData
.filter((d) => d.close !== undefined)
Expand Down

0 comments on commit 2dc53ee

Please sign in to comment.