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

Re: Dialog-editing bug in graphic-items.Lisp



At  1:38 PM 3/11/94 -0500, John R. Gersh wrote:
>>Keith Erf remonded me of this old outstanding bug, so I finally looked
>>at it. My apologies if this has been causing anyone grief.
>
>Not to me. For me this was in the category of interesting-puzzle-bug rather
>than stop-the-presses-bug. I'm impressed that something this unimportant
>still got to the head of the queue eventually.

You're assuming a more formal bug fixing mechanism than I use.
If people make noise, I tend to do something about it, especially
if it's easy.

>
>>
>>MCL has a mechanism for dealing with the case of a simple-view
>>drawing outside of its boundaries. This is also done by the frame
>>drawn around a default button-dialog-item. The view-corners method
>>needs to deal with it:
>
>Thanks for pointing this out. I should have thought to look for a general
>mechanism to deal with this situation.
>
>
>>
>>; The title extends outside of the bounding box, so we need to correct.
>>(defmethod view-corners ((item title-box-dialog-item))
>>  (multiple-value-bind (tl br) (call-next-method)
>>    (values (add-points tl (make-point 0 (nth-value 1 (label-offset item))))
>>            br)))
>
>
>This still seems to have some problems:
>
>(1) It pushes the tl corner up by (- ascent/2 ascent), but the
>view-draw-contents method draws the text exactly 5 pixels down, not
>ascent/2 down. Did you also replace the
>
>(#_MoveTo :long (add-points topleft #@(6 5)))
>
>in the view-draw-contents with
>
>(#_MoveTo :long (add-points topleft (nth-value 0 (label-offset item))))?
>
>Without this change, you still get the bit-dribbles with larger font sizes.
>(And there must have been _some_ use intended for the first value in
>label-offset!)

Yes, I made that change, but I forgot to send it in my message.
To get code that really works, ask for the whole "graphic-dialog-items.lisp"
file.

>
>
>(2) It doesn't account for cases where the text is wider or taller than the
>box. My fix shortened the text, which I thought looked better, but a
>simpler fix would be to use:
>
>(defmethod view-corners ((item title-box-dialog-item))
>  (multiple-value-bind (tl br) (call-next-method)
>    (multiple-value-bind (in out drop) (label-offset item)
>      (values (add-points tl (make-point 0 out))
>            (add-points br (make-point
>                            (max (point-h (view-size item))
>                                 (string-width (dialog-item-text item)))
>                            (max (point-v (view-size item))
>                                 (+ (point-v in) drop))))))))

Neither I nor the original writers of the code thought of that
possibility. Don't think I'll bother to fix it.