Author Topic: Can a Shape discover if it is visible in the window?  (Read 735 times)

0 Members and 1 Guest are viewing this topic.

bhwithun

  • Newbie
  • *
  • Posts: 1
Can a Shape discover if it is visible in the window?
« on: October 28, 2019, 06:24:55 AM »
I've built a set of smart shapes for sequence diagrams.

I'd really like my actor headings to know if they're visible in the editor window.
If the actor line is visible, I am thinking I can bring the actor label down, so that it appears to float at the top of the actor line if you're zoomed in really far.  Otherwise you just see a line with no label at the top.  I have to keep scrolling up to discover which line belongs to which actor.

To do this (if it's even possible) I think I need my actor heading shapes to inspect the position of the actor line they're attached to.  If some portion of the actor line is on the visible screen, then the actor heading can position itself atop that line, very close to the top.

I suppose this would complicate printing the full diagram.  I'd have to zoom all the way out so that the shapes all print in their normal positions.

Is it possible for a shape to detect whether itself (or another shape) is on the visible screen and, if so, to calculate how to move itself to be near the top of the visible screen?