[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] usage of wind_calc()



on 7/5/2005 9:43 PM, Odd Skancke wrote:

> tir, 05,.07.2005 kl. 21.45 +0200, skrev Arnaud BERCEGEAY:
>> Hello,
>> 
>>>>>  WM_xxx messages contain work instead of full area coordinates,
>>>>> wind_set/get() works with work areas too. No change in the way things
>>>>> are handled here, except from cases where the application needs to
>>>>> modify the new positions. For example snap this is what is needed now;
>>>>> 
>>>>>  1. new_pos = WM_MOVED coordinates
>>>>>  2. new_pos = wind_calc(WC_WORK, new_pos)
>>>>>  3. snap(new_pos)
>>>>>  4. new_pos = wind_calc(WC_BORER, new_pos)
>>>>>  5. wind_set(handle, WF_CURRXYWH, new_pos)
>>>> 
>>>> I don't agree at all ? Do you do such nasty stuff in your own
>>>> applications
>>> 
>>>  Have you ever tried to snap a window containing text using the fonts
>>> with/heigh? Have you ever looked at Qed source? Have you ever seen
>>> Everest? You tell me how else to snap coordinates!
>> 
>> I cannot believe it ;)
>> 
>> Your only argument is application optimised to be faster on old "real
>> ATARI" computer without graphic card and with old VDI.
>> 
>> I don't remember why exactly the snap is needed, but i think it's because
>> of a line-A function to paste bitmap of characters to the screen, or
>> something like that. Maybe a VDI guru can give more information.
>> 
>> Anyway, the snap stuff is no more usefull...
> 
> Ok. Tell that to Lonny Pursell. Tell that to the dude who wrote Qed.
> Tell that applications that force the window width/height to be no
> larger than a picture it shows. The above shows that you are so ignorant
> that I dont want to discuss this with you any further.

Well there are 2 distinct types of snapping that can occur, and possibly
some of it is getting confused.

For certain apps I like to snap the WORK area to an even char w/h.  This
allows for fast calculations, predictable cursor movements and so forth.  I
don't see the point in having extra pixels at the far edge of the window
that might be unused. Not to mention depending on the font width the unused
pixel area will vary in width itself.  So for my purposes it seems better to
snap the interior WORK area for a cleaner look.  Since the window contents
do not scroll left and right in my editor, this is the look I want.

Then there is window placement snapping on the X/Y.  Which I generally never
do.

That said, there are pros and cons to both.  We can debate forever if it's
good or bad to snap any of the values.   It very much depends on the project
and the effect the programmer is trying to achieve.  And yes others can
argue and try to persuade or suggest other approaches to avoid snapping.
However I feel as Ingo does, that snapping under certain circumstances is
perfectly acceptable even today.

-- 
Lonny Pursell    http://www.bright.net/~gfabasic/