[Oberon] FPGA - DIY Dialogs

Tomas Kral thomas.kral at email.cz
Fri Jan 25 15:08:23 CET 2019


On Wed, 23 Jan 2019 20:37:42 +0100
Tomas Kral <thomas.kral at email.cz> wrote:

> I could try evaluate rectangle intersections in a list, and redraw
> only overlapping frames

I do intersection check below, almost flicker free graphics, except
when some frames overlap. (p.frame # o.frame) is a guard against itself.

  PROCEDURE Overlap*(o: Object): BOOLEAN;
    VAR p: Object; overlap: BOOLEAN;
  BEGIN p := first; overlap := FALSE;
    WHILE ~ overlap & (p # NIL) DO
      IF (p.frame # o.frame) &
        (o.x < p.x+p.w) & (o.x+o.w > p.x) & 
        (o.y-o.h < p.y) & (o.y > p.y-p.h) THEN overlap := TRUE
      END ;  p := p.next
    END ;
    RETURN overlap
  END Overlap;



-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list