Pekka Paalanen wrote:

+    <request name="set_source" since="2">
+      <description summary="set the source rectangle for cropping">
+       Set the source rectangle of the associated wl_surface. See
+       wl_viewport for the description, and relation to the wl_buffer
+       size.
+
+       If width and/or height are negative, the source rectangle is unset
+       instead.
+
+    <request name="set_destination" since="2">
+      <description summary="set the surface size for scaling">
+       Set the destination size of the associated wl_surface. See
+       wl_viewport for the description, and relation to the wl_buffer
+       size.
+
+       If width and/or height are negative or zero, the destination size
+       is unset instead.

I think you may have the <=0 and <0 reversed here. A zero-sized source cannot be used (unless the destination is zero-sized) so that should not be considered valid. But a zero-sized destination does make physical sense (the image is scaled to invisibly tiny).

However the result of a zero-sized destination (or a zero-sized source when the destination is unset) can be achieved by the client hiding the surface instead, so I think there is no reason to support it. Therefore I think it would be best if both rectangles used zero to mean unset. This is easier for software to test for with readable code, too.

You may also want to reserve negative numbers for future use. They could conceivably do reflections. Not sure if that is useful but it might be best if such negative numbers were errors rather than meaning unset.
_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to