chiark / gitweb /
Rewrite trim_rect() for robustness.
authorSimon Tatham <anakin@pobox.com>
Mon, 1 Apr 2013 16:23:03 +0000 (16:23 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 1 Apr 2013 16:23:03 +0000 (16:23 +0000)
commit01471b5dc98e80a5ca0874b7be7a202700c93dae
tree9702c28cb88675ba6431da84ce65f5e877da11cb
parentbce3f1bd2680b0f6bd6f6781b551c7c6b1e51f65
Rewrite trim_rect() for robustness.

The previous version dealt adequately with rectangles _partially_
overlapping the edge of the canvas, but doesn't correctly handle a
rectangle that's completely out of bounds in one direction. Replace
with a complete rewrite which is more easily seen to be correct. Also,
while I'm at it, add a missing condition to draw_update() so that we
don't even bother calling the Javascript half of it on any rectangle
that's been trimmed into nonexistence.

[originally from svn r9800]
emcc.c