{"record":{"id":"749c90ed337c91fb","repo":"stride3d/stride","slug":"value-gestureconfigcomposite","errorCode":null,"errorMessage":"value","messagePattern":"value","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Input/Gestures/GestureConfigComposite.cs","lineNumber":33,"sourceCode":"    public sealed class GestureConfigComposite : GestureConfig\n    {\n        /// <summary>\n        /// The scale value above which the gesture is started.\n        /// </summary>\n        /// <exception cref=\"ArgumentOutOfRangeException\">The value has to be greater or equal to 1.</exception>\n        /// <exception cref=\"InvalidOperationException\">Tried to modify the configuration after it has been frozen by the system.</exception>\n        /// <remarks>The user can increase this value if he has small or no interest in the scale component of the transformation. \n        /// By doing so, he avoids triggering the Composite Gesture when only small scale changes happen. \n        /// On the contrary, the user can decrease this value if he wants to be immediately warned about the smallest change in scale.</remarks>\n        public float MinimumScaleValue\n        {\n            get { return minimumScaleValue; }\n            set\n            {\n                CheckNotFrozen();\n\n                if (value <= 1)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                minimumScaleValue = value;\n                MinimumScaleValueInv = 1 / minimumScaleValue;\n            }\n        }\n        private float minimumScaleValue;\n\n        internal float MinimumScaleValueInv { get; set; }\n\n        /// <summary>\n        /// The translation distance above which the gesture is started.\n        /// </summary>\n        /// <exception cref=\"ArgumentOutOfRangeException\">The value has to be positive.</exception>\n        /// <exception cref=\"InvalidOperationException\">Tried to modify the configuration after it has been frozen by the system.</exception>\n        /// <remarks>The user can increase this value if he has small or no interest in the translation component of the transformation. \n        /// By doing so, he avoids triggering the Composite Gesture when only small translation changes happen. \n        /// On the contrary, the user can decrease this value if he wants to be immediately warned about the smallest change in translation.</remarks>\n        public float MinimumTranslationDistance","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Input/Gestures/GestureConfigComposite.cs#L15-L51","documentation":"GestureConfigComposite.MinimumScale throws ArgumentOutOfRangeException with paramName \"value\" when the assigned scale is <= 1. The library requires a pinch's minimum scale factor to be strictly greater than 1 so the gesture only triggers on a genuine zoom-in. This is a configuration-time validation enforced after CheckNotFrozen().","triggerScenarios":"Assigning MinimumScale a value of 1, 0, negative, or any value not strictly greater than 1, e.g. compositeConfig.MinimumScale = 1f or = 0f, on an unfrozen GestureConfigComposite.","commonSituations":"Initializing gesture recognition config from user settings or designer fields that default to 0; assuming scale is a fraction (1.0 = no zoom) instead of a strict threshold; copy-pasting config code from drag/press gestures where 0 is valid.","solutions":["Set MinimumScale to a value strictly greater than 1, e.g. 1.1f or 1.5f","Verify the value source (config file, UI field) has a sensible non-unity default","Add caller-side validation before assigning to fail early with a clearer message"],"exampleFix":"// before\ncompositeConfig.MinimumScale = 1f;\n// after\ncompositeConfig.MinimumScale = 1.1f;","handlingStrategy":"validation","validationCode":"if (float.IsNaN(minScale) || minScale <= 1f) throw new ArgumentException(\"MinimumScale must be > 1\");\ncompositeConfig.MinimumScale = minScale;","typeGuard":"bool IsValidMinScale(float v) => !float.IsNaN(v) && v > 1f;","tryCatchPattern":"try { compositeConfig.MinimumScale = value; }\ncatch (ArgumentOutOfRangeException ex) when (ex.ParamName == \"value\")\n{\n    logger.LogWarning(\"MinimumScale {Value} invalid; using 1.1f\", value);\n    compositeConfig.MinimumScale = 1.1f;\n}","preventionTips":["Use a default strictly above 1 (e.g. 1.1f) in any config/UI exposing this setting","Validate before assignment since GestureConfig cannot represent 'unset'","Remember scale is a zoom-in threshold, not a ratio tolerance"],"tags":["csharp","argument-out-of-range","input","gestures"],"backgroundTag":"argument-out-of-range","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}