mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-24 21:55:52 +02:00
Archive commit
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { times } from 'lodash';
|
||||
|
||||
@Component({
|
||||
selector: 'scale-picker',
|
||||
templateUrl: 'scale-picker.pug',
|
||||
})
|
||||
export class ScalePicker {
|
||||
@Input() scale = 1;
|
||||
@Output() scaleChange = new EventEmitter<number>();
|
||||
scales = [1, 2, 3, 4];
|
||||
@Input() set maxScale(value: number) {
|
||||
this.scales = times(value, i => i + 1);
|
||||
}
|
||||
setScale(value: number) {
|
||||
if (value !== this.scale) {
|
||||
this.scale = value;
|
||||
this.scaleChange.emit(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user