Fixed invalidate graph area to include top and right margins
This commit is contained in:
parent
0adf438a62
commit
9c62737be1
@ -1,6 +1,6 @@
|
||||
/**
|
||||
* BBTimeline
|
||||
* @version v0.1.0.076 (2023/09/30 1432)
|
||||
* @version v0.1.0.089 beta (2023/10/14 1658)
|
||||
*/
|
||||
class BBTimeline {
|
||||
constructor(el) {
|
||||
@ -321,9 +321,11 @@ class BBTimeline {
|
||||
|
||||
if (a.Debug) a.drawRectangle(e.HitBox);
|
||||
if (a.Debug) console.log(e);
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
if (a.Debug) a.drawRectangle(a.GraphRectangle);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -457,8 +459,23 @@ class BBTimeline {
|
||||
|
||||
clearChart() {
|
||||
const a = this;
|
||||
const rect = {
|
||||
X: a.GraphRectangle.X,
|
||||
Y: a.GraphRectangle.Y,
|
||||
W: a.GraphRectangle.W,
|
||||
H: a.GraphRectangle.H
|
||||
};
|
||||
|
||||
a.ctx.clearRect((a.GraphRectangle.X + a.Axis.LineWidth), a.GraphRectangle.Y, (a.GraphRectangle.W -a.Axis.LineWidth), (a.GraphRectangle.H - a.Axis.LineWidth));
|
||||
rect.X += a.Axis.LineWidth;
|
||||
rect.Y -= a.Padding.Top;
|
||||
rect.W -= a.Axis.LineWidth;
|
||||
rect.W += a.Padding.Right;
|
||||
rect.H -= a.Axis.LineWidth;
|
||||
rect.H += a.Padding.Top;
|
||||
|
||||
a.ctx.clearRect(rect.X, rect.Y, rect.W, rect.H);
|
||||
|
||||
if (a.Debug) a.drawRectangle(rect);
|
||||
|
||||
// Clear marker positions
|
||||
const visibleEvents = a.FindVisibleEvents();
|
||||
@ -478,8 +495,6 @@ class BBTimeline {
|
||||
a.ctx.lineWidth = a.Axis.LineWidth;
|
||||
a.ctx.strokeStyle = a.Axis.LineColour1;
|
||||
a.ctx.stroke();
|
||||
|
||||
if (a.Debug) a.drawRectangle(a.GraphRectangle);
|
||||
}
|
||||
|
||||
drawXAxis() {
|
||||
|
4
bbtimeline.min.js
vendored
4
bbtimeline.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user