Support deriving from DefaultLabelModel

The DefaultLabelModel constructor deviated from pattern followed by the other Default*Model types, where `...options` is merged after the hardcoded values so that derived classes can override the options. This change makes it conform to that pattern.
This commit is contained in:
Steve Ruble
2020-04-23 17:16:08 -04:00
committed by GitHub
parent 86b4c97e89
commit ff2a668842

View File

@ -12,9 +12,9 @@ export interface DefaultLabelModelGenerics extends LabelModelGenerics {
export class DefaultLabelModel extends LabelModel<DefaultLabelModelGenerics> {
constructor(options: DefaultLabelModelOptions = {}) {
super({
...options,
offsetY: options.offsetY == null ? -23 : options.offsetY,
type: 'default'
type: 'default',
...options
});
}