{"record":{"id":"e42820104c665e47","repo":"stride3d/stride","slug":"value-gestureconfiglongpress","errorCode":null,"errorMessage":"value","messagePattern":"value","errorType":"validation","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Input/Gestures/GestureConfigLongPress.cs","lineNumber":29,"sourceCode":"    public sealed class GestureConfigLongPress : GestureConfig\n    {\n        /// <summary>\n        /// The value represents the maximum distance a finger can translate during the longPress action.\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>\n        /// By increasing this value, the user allows small movements of the fingers during the long press.\n        /// By decreasing this value, the user forbids any movements during the long press.</remarks>\n        public float MaximumTranslationDistance\n        {\n            get { return maximumTransDst; }\n            set\n            {\n                CheckNotFrozen();\n\n                if (value < 0)\n                    throw new ArgumentOutOfRangeException(\"value\");\n\n                maximumTransDst = value;\n            }\n        }\n        private float maximumTransDst;\n\n        /// <summary>\n        /// The time the user has to hold his finger on the screen to trigger the gesture.\n        /// </summary>\n        /// <exception cref=\"InvalidOperationException\">Tried to modify the configuration after it has been frozen by the system.</exception>\n        public TimeSpan RequiredPressTime\n        {\n            get { return requiredPressTime; }\n            set\n            {\n                CheckNotFrozen();\n\n                requiredPressTime = value;","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Input/Gestures/GestureConfigLongPress.cs#L11-L47","documentation":"GestureConfigLongPress.MaximumDistance (maximumTransDst) throws ArgumentOutOfRangeException with paramName \"value\" when the assigned maximum translation distance is negative. The touch must stay within this radius of its start point; radius is a magnitude >= 0.","triggerScenarios":"Assigning a negative float to MaximumDistance on an unfrozen GestureConfigLongPress, typically from signed math or bad config defaults.","commonSituations":"Computing a radius from a delta without Abs(); -1 'unset' sentinel values in config files; copy-paste sign errors.","solutions":["Assign a non-negative distance, e.g. MaximumDistance = 30f","Apply Math.Abs() to computed values before assignment","Sanitize config-loaded values, treating negatives as invalid"],"exampleFix":"// before\nlongPressConfig.MaximumDistance = -1f;\n// after\nlongPressConfig.MaximumDistance = 30f;","handlingStrategy":"validation","validationCode":"if (float.IsNaN(d) || d < 0f) throw new ArgumentException(\"MaximumDistance must be >= 0\");\nlongPressConfig.MaximumDistance = d;","typeGuard":"bool IsValidRadius(float v) => !float.IsNaN(v) && v >= 0f;","tryCatchPattern":"try { longPressConfig.MaximumDistance = d; }\ncatch (ArgumentOutOfRangeException ex) when (ex.ParamName == \"value\")\n{\n    longPressConfig.MaximumDistance = 30f;\n}","preventionTips":["Abs() any radius computed from deltas","Replace -1 sentinels with explicit 'not configured' handling","Use one validated config-mapping layer for all gesture thresholds"],"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-16T04:17:20.429Z"}