Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!pasteur!agate!eris!bryce From: bryce@eris (Bryce Nesbitt) Newsgroups: comp.sys.amiga Subject: Re: help: proportional gadgets Message-ID: <7143@agate.BERKELEY.EDU> Date: 24 Feb 88 02:10:29 GMT References: <585@oscvax.UUCP> Sender: usenet@agate.BERKELEY.EDU Organization: University of California, Berkeley Lines: 49 In article <585@oscvax.UUCP> jan@oscvax.UUCP (Jan Sven Trabandt) writes: > >According to the Intuition manual, in their example for a proportional >gadget(vertical) they say... > >...Did things change or am I just enterpreting (sic) things wrong. I think things changed. Try using this: (From the "Amiga Enhancer Manual") Proportional Gadgets -------------------- Consider as an example scrolling a 25 line view of a 100 line display. In the following, the variables "visible_lines" and "total_lines" would take the values 25 and 100, respectively. The first relationship is easy: make the Body value represent "one-fourth." This can be expressed as VertBody = (ULONG)(visible_lines*0xFFFF)/total_lines; If you can special-case zero visible_lines, then this works: VertBody = ((ULONG)(visible_lines<<16) -1)/total_lines; Now, note that when you are displaying the last "page," line 75 is the top line in view (start line numbers from zero). Therefore, when the VertPot value is a maximum (0xFFFF) you need to convert this to 75, and so on. This can be done like so: top_line = ((ULONG)(total_lines-visible_lines)*VertPot+(1<<15))>>16; The inverse of this operation is needed if you wish to ini- tialize the pot for some particular value of top_lines. VertPot = MIN(0xFFFF, ((top_line_input<<16))/(total_lines-visible_lines)); The MIN macro is used because "unity" is actually 0xFFFF. |\_/| . ACK!, NAK!, EOT!, SOH! {O_o} . Bryce Nesbitt (") BIX: mleeds (temporarily) U USENET: bryce@eris.berkeley.EDU -or- ucbvax!eris!bryce