Add toString method to aspect ratio enum
This commit is contained in:
parent
aec87e7681
commit
df2b0f5614
@ -6,6 +6,19 @@ var AspectRatio = Object.freeze({
|
|||||||
FitHeight: 3, // legacy/dynamic: fit to height
|
FitHeight: 3, // legacy/dynamic: fit to height
|
||||||
Fixed: 4, // pre-determined aspect ratio
|
Fixed: 4, // pre-determined aspect ratio
|
||||||
Manual: 5, // ratio achieved by zooming in/zooming out
|
Manual: 5, // ratio achieved by zooming in/zooming out
|
||||||
|
|
||||||
|
toString: (ar) => {
|
||||||
|
switch (ar) {
|
||||||
|
case -1: return 'Initial';
|
||||||
|
case 0: return 'Reset';
|
||||||
|
case 1: return 'Automatic';
|
||||||
|
case 2: return 'FitWidth';
|
||||||
|
case 3: return 'FitHeight';
|
||||||
|
case 4: return 'Fixed';
|
||||||
|
case 5: return 'Manual';
|
||||||
|
default: return '<not an valid enum value>'
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export default AspectRatio;
|
export default AspectRatio;
|
||||||
|
Loading…
Reference in New Issue
Block a user