mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 01:58:27 +00:00
feat: @idraw/board add getScrollLineWidth method
This commit is contained in:
parent
2ed2fbc354
commit
6c428a77a4
3 changed files with 11 additions and 2 deletions
|
|
@ -86,6 +86,8 @@
|
|||
console.log('result =', result);
|
||||
board.draw();
|
||||
|
||||
console.log('scrollLineWidth = ', board.getScrollLineWidth())
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -155,6 +155,10 @@ class Board {
|
|||
this.draw();
|
||||
}
|
||||
|
||||
getScrollLineWidth(): number {
|
||||
return this[_scroller].getLineWidth();
|
||||
}
|
||||
|
||||
private [_render]() {
|
||||
if (this[_hasRendered] === true) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -19,13 +19,11 @@ type TypePrivateOptions = TypeOptions & {
|
|||
scrollConfig: TypeBoardScrollConfig,
|
||||
}
|
||||
|
||||
|
||||
const defaultScrollConfig = {
|
||||
lineWidth: 12,
|
||||
color: '#a0a0a0'
|
||||
}
|
||||
|
||||
|
||||
export class Scroller {
|
||||
|
||||
private _displayCtx: CanvasRenderingContext2D;
|
||||
|
|
@ -124,6 +122,11 @@ export class Scroller {
|
|||
return false;
|
||||
}
|
||||
|
||||
getLineWidth(): number {
|
||||
const lineWidth = this._opts.scrollConfig.lineWidth;
|
||||
return lineWidth;
|
||||
}
|
||||
|
||||
|
||||
calc(position: TypeScreenPosition) {
|
||||
const { width, height, scrollConfig } = this._opts;
|
||||
|
|
|
|||
Loading…
Reference in a new issue