Add toString method to aspect ratio enum

This commit is contained in:
Tamius Han 2021-01-12 23:18:14 +01:00
parent aec87e7681
commit df2b0f5614

View File

@ -6,6 +6,19 @@ var AspectRatio = Object.freeze({
FitHeight: 3, // legacy/dynamic: fit to height
Fixed: 4, // pre-determined aspect ratio
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;