mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
adjust size based on position
This commit is contained in:
+2
-5
@@ -555,15 +555,12 @@ function addDecoration() {
|
||||
}
|
||||
|
||||
function addOverviewRuler() {
|
||||
term.options['overviewRulerWidth'] = 13;
|
||||
const canvas = term.registerDecoration({marker: term.addMarker(1), overviewRulerOptions: { color: '#ef2929' }});
|
||||
term.options['overviewRulerWidth'] = 12;
|
||||
term.registerDecoration({marker: term.addMarker(1), overviewRulerOptions: { color: '#ef2929' }});
|
||||
term.registerDecoration({marker: term.addMarker(3), overviewRulerOptions: { color: '#8ae234' }});
|
||||
term.registerDecoration({marker: term.addMarker(5), overviewRulerOptions: { color: '#729fcf' }});
|
||||
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#ef2929', position: 'left' }});
|
||||
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#8ae234', position: 'center' }});
|
||||
term.registerDecoration({marker: term.addMarker(7), overviewRulerOptions: { color: '#729fcf', position: 'right' }});
|
||||
canvas.onRender((e) => {
|
||||
e.style.left = `${document.querySelector('.xterm-viewport').clientWidth + 1}px`;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
this._decorationElements.delete(decoration);
|
||||
return;
|
||||
}
|
||||
this._ctx.lineWidth = 1;
|
||||
this._ctx.lineWidth = !decoration.options.overviewRulerOptions.position ? 2 : 6;
|
||||
this._ctx.strokeStyle = decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.strokeRect(
|
||||
!decoration.options.overviewRulerOptions.position || decoration.options.overviewRulerOptions.position === 'left' ? 0 : decoration.options.overviewRulerOptions.position === 'right' ? workArray[WorkIndex.OUTER_SIZE] + workArray[WorkIndex.INNER_SIZE]: workArray[WorkIndex.OUTER_SIZE],
|
||||
|
||||
Reference in New Issue
Block a user