🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1544

Zooming on GraphicBlock

#1544
From: Doron Shalmon
Date: Thu, 27 Jun 1991 20:42
38 lines
1961 bytes
I am running InterViews v2.6 and have adjusters operating on
a GraphicBlock.  In particular, I have an Enlarger and a Reducer
for zooming in and out.  I need a "home" button to zoom back
to the graphic's original size.  I created a class, subclassed
from Adjuster, whose AdjustView method (see below) resets the
curwidth and curheight of the GraphicBlock's perpective back
to its width and height, respectively.  This does not seem to
work properly (at least not consistently), and I was wondering
if this was the right way to do this.

Thanks for any suggestions,

Doron

-- 

void HomeZoomer::AdjustView (Event&) {
    register Perspective* s = shown;
    Coord cx, cy;

    *s = *view->GetPerspective();
    cx = s->curx + s->curwidth/2;
    cy = s->cury + s->curheight/2;
    s->curwidth = s->width;
    s->curheight = s->height;
    s->curx = cx - s->curwidth/2;
    s->cury = cy - s->curheight/2;
    view->Adjust(*s);
}

===========================================================================
                               Doron Shalmon
           Bellcore -- Network Planning and Distribution Systems
                  Internet:  doron@yogi.leis.bellcore.com
                      UUCP:  ...!bellcore!yogi!doron

    "All opinions expressed are mine, and do not necessarily represent
      those of my employer, Bell Communications Research (Bellcore)"
Technical Details
Message-ID: <1991Jun27.204219.3128@bellcore.bellcore.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bellcore!corral!doron

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!bellcore!corral!doron
From: doron@corral.leis.bellcore.com (Doron Shalmon)
Newsgroups: comp.windows.interviews
Subject: Zooming on GraphicBlock
Keywords: zoom enlarger reducer home graphicblock perspective
Message-ID: <1991Jun27.204219.3128@bellcore.bellcore.com>
Date: 27 Jun 91 20:42:19 GMT
Sender: usenet@bellcore.bellcore.com (Poster of News)
Reply-To: doron@mobydick.leis.bellcore.com
Followup-To: comp.windows.interviews
Organization: Bellcore, Piscataway, NJ
Lines: 38