Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-24825

Windows: Ti.UI.View.center is incorrectly calculated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 6.1.0
    • Fix Version/s: Release 6.2.0
    • Component/s: Windows
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      2017 Sprint 17 SDK

      Description

      • The center property of View is incorrectly calculated, producing invalid positioning.

      var window = Ti.UI.createWindow({backgroundColor: 'gray'}),
          a = Ti.UI.createView({backgroundColor: 'red', width: 200, height: 200, top: 0, left: 0}),
          b = Ti.UI.createView({backgroundColor: 'blue', width: 100, height: 100, center: {x: 150, y: 150}}),
          btn_a = Ti.UI.createButton({title: 'TOP LEFT', bottom: 0, left: 0, width: '50%'}),
          btn_b = Ti.UI.createButton({title: 'ZERO', bottom: 0, right: 0, width: '50%'});
       
      btn_a.addEventListener('click', function(){
          b.center = {x: '50%', y: '50%'};
      });
       
      window.add([btn_a, a, b]);
      window.open();
      

      Expected:
      The "center" property is supposed to be relative to the parent's top-left corner.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kiguchi Kota Iguchi
                Reporter:
                gmathews Gary Mathews
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-10778
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code