Opened 16 years ago

Closed 6 years ago

#2509 closed bug (not reproducible)

Unarchived BTextControl's _BTextInput_ has a bad text rect

Reported by: shinta Owned by: nobody
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description

When we unarchived BTextControl, the position of text rect of its text view (_BTextInput_) is bad. Top margin is too large.

Haiku: hrev26161
SHINTA (bug No.20)

Attachments (3)

BL_DI_20080708A.png (4.4 KB ) - added by shinta 16 years ago.
This is the symptom.
ArcTextControl.diff (1.4 KB ) - added by shinta 16 years ago.
TextView.cpp.2509c.diff (796 bytes ) - added by shinta 16 years ago.

Download all attachments as: .zip

Change History (10)

by shinta, 16 years ago

Attachment: BL_DI_20080708A.png added

This is the symptom.

by shinta, 16 years ago

Attachment: ArcTextControl.diff added

comment:1 by shinta, 16 years ago

In _BTextInput_::AlignTextRect(), LineHeight(0) returns 1 if BTextControl is unarchived. So, I used font_height instead of LineHeight(0).

Additionaly, BTextControl::_InitData() doesn't need to configure text rect because AlignTextRect() is called just after.

comment:2 by shinta, 16 years ago

Above patch fixes this bug.

comment:3 by stippi, 16 years ago

I don't understand the change to TextControl.cpp at all. As for the change to TextInput.cpp, I am not sure yet - it should be investigated why LineHeight(0) fails for the case when the control is unarchived. The patch looks like a workaround, not like the fix to the real problem.

by shinta, 16 years ago

Attachment: TextView.cpp.2509c.diff added

comment:4 by shinta, 16 years ago

Above patch is another idea.

LineHeight(0) calls _FindLineBreaks() eventually. I don't know whether removing check of fStyles->IsValidNullStyle() is OK or not. But, at leaset, it seems strange that ascent and descent aren't set when fStyles->IsValidNullStyle() is false.

comment:5 by mmadia, 14 years ago

patch: 01

comment:6 by axeld, 8 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:7 by pulkomandy, 6 years ago

Resolution: not reproducible
Status: assignedclosed

hrev52124 shows that the problem is not reproductible - archiving and unarchiving works fine. I assume it has been fixed since then, unless there is some application still reproducing this.

Note: See TracTickets for help on using tickets.