Merge pull request #3841 from Tyriar/3840
Allow up to double the size for overview ruler decorations
This commit is contained in:
@@ -88,6 +88,7 @@ export class OverviewRulerRenderer extends Disposable {
|
|||||||
}));
|
}));
|
||||||
this.register(this._bufferService.onScroll(() => {
|
this.register(this._bufferService.onScroll(() => {
|
||||||
if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {
|
if (this._lastKnownBufferLength !== this._bufferService.buffers.normal.lines.length) {
|
||||||
|
this._refreshDrawHeightConstants();
|
||||||
this._refreshColorZonePadding();
|
this._refreshColorZonePadding();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
@@ -132,10 +133,7 @@ export class OverviewRulerRenderer extends Disposable {
|
|||||||
drawWidth.center = innerWidth;
|
drawWidth.center = innerWidth;
|
||||||
drawWidth.right = outerWidth;
|
drawWidth.right = outerWidth;
|
||||||
// height
|
// height
|
||||||
drawHeight.full = Math.round(2 * window.devicePixelRatio);
|
this._refreshDrawHeightConstants();
|
||||||
drawHeight.left = Math.round(6 * window.devicePixelRatio);
|
|
||||||
drawHeight.center = Math.round(6 * window.devicePixelRatio);
|
|
||||||
drawHeight.right = Math.round(6 * window.devicePixelRatio);
|
|
||||||
// x
|
// x
|
||||||
drawX.full = 0;
|
drawX.full = 0;
|
||||||
drawX.left = 0;
|
drawX.left = 0;
|
||||||
@@ -143,6 +141,17 @@ export class OverviewRulerRenderer extends Disposable {
|
|||||||
drawX.right = drawWidth.left + drawWidth.center;
|
drawX.right = drawWidth.left + drawWidth.center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _refreshDrawHeightConstants(): void {
|
||||||
|
drawHeight.full = Math.round(2 * window.devicePixelRatio);
|
||||||
|
// Calculate actual pixels per line
|
||||||
|
const pixelsPerLine = this._canvas.height / this._bufferService.buffer.lines.length;
|
||||||
|
// Clamp actual pixels within a range
|
||||||
|
const nonFullHeight = Math.round(Math.max(Math.min(pixelsPerLine, 12), 6) * window.devicePixelRatio);
|
||||||
|
drawHeight.left = nonFullHeight;
|
||||||
|
drawHeight.center = nonFullHeight;
|
||||||
|
drawHeight.right = nonFullHeight;
|
||||||
|
}
|
||||||
|
|
||||||
private _refreshColorZonePadding(): void {
|
private _refreshColorZonePadding(): void {
|
||||||
this._colorZoneStore.setPadding({
|
this._colorZoneStore.setPadding({
|
||||||
full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),
|
full: Math.floor(this._bufferService.buffers.active.lines.length / (this._canvas.height - 1) * drawHeight.full),
|
||||||
|
|||||||
Reference in New Issue
Block a user