UI: Set min/max zoom levels for preview

Prevents the preview from zooming in or out too far.
Min zoom: 10%
Max zoom: 1000%
This commit is contained in:
cg2121
2023-02-13 16:14:57 -06:00
committed by Jim
parent 03a94aee41
commit b464ba8129
2 changed files with 5 additions and 1 deletions

View File

@@ -2255,6 +2255,8 @@ void OBSBasicPreview::ResetScrollingOffset()
void OBSBasicPreview::SetScalingLevel(int32_t newScalingLevelVal)
{
newScalingLevelVal = std::clamp(newScalingLevelVal, -MAX_SCALING_LEVEL,
MAX_SCALING_LEVEL);
float newScalingAmountVal =
pow(ZOOM_SENSITIVITY, float(newScalingLevelVal));
scalingLevel = newScalingLevelVal;