Opened 11 years ago

Closed 10 months 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:
Has a Patch: yes 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 11 years ago.
This is the symptom.
ArcTextControl.diff (1.4 KB) - added by shinta 11 years ago.
TextView.cpp.2509c.diff (796 bytes) - added by shinta 11 years ago.

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by shinta

Attachment: BL_DI_20080708A.png added

This is the symptom.

Changed 11 years ago by shinta

Attachment: ArcTextControl.diff added

comment:1 Changed 11 years ago by shinta

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 Changed 11 years ago by shinta

Above patch fixes this bug.

comment:3 Changed 11 years ago by stippi

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.

Changed 11 years ago by shinta

Attachment: TextView.cpp.2509c.diff added

comment:4 Changed 11 years ago by shinta

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 Changed 9 years ago by mmadia

Has a Patch: set

comment:6 Changed 2 years ago by axeld

Owner: changed from axeld to nobody
Status: newassigned

comment:7 Changed 10 months ago by pulkomandy

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.