Explorar el Código

Merge pull request #84656 from AThousandShips/clamp_detail

Clarify that `@GlobalScope.clamp` does not do component-wise clamping
Rémi Verschelde hace 1 año
padre
commit
9a7207928a
Se han modificado 1 ficheros con 2 adiciones y 13 borrados
  1. 2 13
      doc/classes/@GlobalScope.xml

+ 2 - 13
doc/classes/@GlobalScope.xml

@@ -234,20 +234,9 @@
 
 				var b = clamp(8.1, 0.9, 5.5)
 				# b is 5.5
-
-				var c = clamp(Vector2(-3.5, -4), Vector2(-3.2, -2), Vector2(2, 6.5))
-				# c is (-3.2, -2)
-
-				var d = clamp(Vector2i(7, 8), Vector2i(-3, -2), Vector2i(2, 6))
-				# d is (2, 6)
-
-				var e = clamp(Vector3(-7, 8.5, -3.8), Vector3(-3, -2, 5.4), Vector3(-2, 6, -4.1))
-				# e is (-3, -2, 5.4)
-
-				var f = clamp(Vector3i(-7, -8, -9), Vector3i(-1, 2, 3), Vector3i(-4, -5, -6))
-				# f is (-4, -5, -6)
 				[/codeblock]
-				[b]Note:[/b] For better type safety, use [method clampf], [method clampi], [method Vector2.clamp], [method Vector2i.clamp], [method Vector3.clamp], [method Vector3i.clamp], [method Vector4.clamp], [method Vector4i.clamp], or [method Color.clamp].
+				[b]Note:[/b] For better type safety, use [method clampf], [method clampi], [method Vector2.clamp], [method Vector2i.clamp], [method Vector3.clamp], [method Vector3i.clamp], [method Vector4.clamp], [method Vector4i.clamp], or [method Color.clamp] (not currently supported by this method).
+				[b]Note:[/b] When using this on vectors it will [i]not[/i] perform component-wise clamping, and will pick [param min] if [code]value < min[/code] or [param max] if [code]value > max[/code]. To perform component-wise clamping use the methods listed above.
 			</description>
 		</method>
 		<method name="clampf">