[haiku-bugs] Re: [Haiku] #13378: Checkmark label alignment too low

  • From: "anirudh" <trac@xxxxxxxxxxxx>
  • Date: Tue, 18 Apr 2017 06:13:20 -0000

#13378: Checkmark label alignment too low
----------------------------------+----------------------------
   Reporter:  humdinger           |      Owner:  nobody
       Type:  enhancement         |     Status:  assigned
   Priority:  normal              |  Milestone:  Unscheduled
  Component:  Kits/Interface Kit  |    Version:  R1/Development
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:
Has a Patch:  1                   |   Platform:  All
----------------------------------+----------------------------

Comment (by anirudh):

 Replying to [comment:16 axeld]:

The code in `BControlLook::DrawLabel()` ([http://cgit.haiku-
 os.org/haiku/tree/src/kits/interface/ControlLook.cpp#n2071 lines 2071ff])
 is responsible for computing the label location, and it should be
 investigated why it doesn't work as expected here, and maybe if there is a
 case where it actually works as it should. This is a relatively new ticket
 -- maybe it's only broken with the new Robo fonts?

 I looked into that, DrawLabel() describes about the label's rectangle
 area, right? It draws the area where the label is supposed to be.
 [http://cgit.haiku-
 os.org/haiku/tree/src/kits/interface/ControlLook.cpp#n2071 lines 2071ff]
 gets the font height, and draws the rectangle accordingly. These do not
 speak about the alignment of label within the rectangle. Do they?

 Should I look into BLayoutUtils::AlignOnRect(), maybe that deals with the
 alignment of label inside the rectangle?

The patch doesn't make any sense to me. Why bottom + 1 - default label
 space? This incorrectly enlarges the label area outside of the view's
 bounds, and only creates a somewhat fitting (it's too high IMO) offset.

 What I presumed was, since the DrawLabel() draws the rectangle, creating a
 padding for the label's bottom will push it to the center.


 Replying to [comment:17 humdinger]:

changing to the old DejaVu, or any other font for that matter, shows the
 same slight vertical misalignment.

 Did my patch fix it for the other fonts, or it fixes only for Noto?

--
Ticket URL: <https://dev.haiku-os.org/ticket/13378#comment:19>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: