mirror of
https://github.com/klinecharts/KLineChart.git
synced 2024-11-25 16:22:43 +08:00
impr: remove redundant base class methods
This commit is contained in:
parent
342bf64bc9
commit
67c58d3284
@ -24,11 +24,11 @@ import { createDom } from '../common/utils/dom'
|
||||
import { getPixelRatio } from '../common/utils/canvas'
|
||||
|
||||
export default abstract class DrawWidget<P extends DrawPane = DrawPane> extends Widget<P> {
|
||||
private _mainCanvas: Canvas
|
||||
private _overlayCanvas: Canvas
|
||||
private readonly _mainCanvas: Canvas
|
||||
private readonly _overlayCanvas: Canvas
|
||||
|
||||
override init (rootContainer: HTMLElement): void {
|
||||
super.init(rootContainer)
|
||||
constructor(rootContainer: HTMLElement, pane: P) {
|
||||
super(rootContainer, pane)
|
||||
this._mainCanvas = new Canvas({
|
||||
position: 'absolute',
|
||||
top: '0',
|
||||
|
@ -26,7 +26,7 @@ export default abstract class Widget<P extends Pane = Pane> extends Eventful imp
|
||||
/**
|
||||
* root container
|
||||
*/
|
||||
private _rootContainer: HTMLElement
|
||||
private readonly _rootContainer: HTMLElement
|
||||
|
||||
/**
|
||||
* Parent pane
|
||||
@ -36,17 +36,13 @@ export default abstract class Widget<P extends Pane = Pane> extends Eventful imp
|
||||
/**
|
||||
* wrapper container
|
||||
*/
|
||||
private _container: HTMLElement
|
||||
private readonly _container: HTMLElement
|
||||
|
||||
private readonly _bounding: Bounding = createDefaultBounding()
|
||||
|
||||
constructor (rootContainer: HTMLElement, pane: P) {
|
||||
super()
|
||||
this._pane = pane
|
||||
this.init(rootContainer)
|
||||
}
|
||||
|
||||
init (rootContainer: HTMLElement): void {
|
||||
this._rootContainer = rootContainer
|
||||
this._container = this.createContainer()
|
||||
rootContainer.appendChild(this._container)
|
||||
|
Loading…
Reference in New Issue
Block a user