Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24541] TextAlign Mishandled on Win Surface on Labels with FILL Width

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionCannot Reproduce
Resolution Date2018-07-26T04:05:08.000+0000
Affected Version/sRelease 6.0.2, Release 6.0.3
Fix Version/sn/a
ComponentsWindows
Labelsn/a
Reporter Ricardo Ramirez
AssigneeKota Iguchi
Created2017-03-28T18:42:31.000+0000
Updated2018-07-26T04:05:08.000+0000

Description

H5. Issue Description Labels that have a width of Ti.UI.FILL and a textAlign of either Titanium.UI.TEXT_ALIGNMENT_LEFT or Titanium.UI.TEXT_ALIGNMENT_RIGHT do not appear correctly after opening their containing Window while the Appcelerator app is in split-screen with another application, then expanding the Appcelerator app to full size. Rather than the text moving all the way to the left or right (depending on alignment), it moves most of the way, leaving a sizable gap between the edge of the Label's view and the start or end (depending on alignment) of the Label's text. The width itself appears to be being calculated correctly, which is easily verifiable by adding a backgroundColor to the Label, but the alignment is aligning to the wrong location and appears to be respecting some kind of padding or margin that can't be interacted with. It appears (just from comparing the visual width of the split-screen version and the post-split-screen version) that the text alignment constants may not be being recalculated properly, instead retaining the original left and right limits as defined on the Window's opening. Please see attached screenshots. This issue does not occur if the Window is loaded in full screen, then reduced down to split-screen, and then returned to full screen. We were able to reproduce this issue both in the affected project, and in a newly created project (which was created intentionally to reproduce the issue in an as-clean-as-possible environment and which was used for the attached screenshots).

Steps to replicate

Download the test case from https://github.com/bbuehler-axway-support/surface-width

Run

Resize the window

Attachments

FileDateSize
Full-Screen_after_Opening_as_Split-Screen.png2017-03-28T18:18:11.000+000022136
Window_Opened_as_Full-Screen (1).png2017-03-28T18:18:11.000+000022129
Window_Opened_as_Split-Screen.png2017-03-28T18:18:20.000+00001882833

Comments

  1. Kota Iguchi 2017-04-03

    I was not able to reproduce this on my Windows 8.1 PC. I don't see margin or padding on the edge of the label text. FYI I would set Label's background color green other than "white" for testing, because Window color is "white" too in your example.
       ".container": {
       	backgroundColor:"white",
       	layout: "vertical"
       }
       "#width_fill_label": {
       	left: 0,
       	textAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,
       	width: Titanium.UI.FILL,
       	color: 'green',
       	backgroundColor: 'purple',
       	height: Ti.UI.SIZE
       }
       
    Also, just in case would you try latest nightly build? appc ti sdk install --branch master 6.1.0.v20170401095755
  2. Samir Mohammed 2017-04-27

    Was able to verify the issue on 6.0.3.GA but was no longer able to reproduce on SDK Version 6.1.0.v20170421082637
  3. Kota Iguchi 2018-07-26

    Closing this as we can't reproduce this on the latest release. Feel free to create new ticket if this is still the case.

JSON Source