Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19897] Label's getRect method returns "not a function" on Windows Phone 8.1

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-11-17T14:14:11.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.1.0
ComponentsWindows
Labelsn/a
ReporterMarian Kucharcik
AssigneeKota Iguchi
Created2015-11-09T12:08:49.000+0000
Updated2017-03-16T22:33:57.000+0000

Description

On Windows Phone 8.1, label's getRect method, which is supposed to return an object throws error: mainText. getRect() is not a function. (In 'mainText.getRect()', 'mainText.getRect' is undefined. I use this method on Android successfully and I need it to calculate weight of a label. Another method which is working on iOS is toImage method, but it's iOS only. Please look at it. Thank you

Comments

  1. Kota Iguchi 2015-11-10

    Fixed by TIMOB-19837.
  2. Marian Kucharcik 2015-11-10

    Hi Kota, will this fix be included in tommorow's(11.11.2015) release? Thanks
  3. Kota Iguchi 2015-11-10

    [~max87] Hi Marian, I'm afraid not. This fix is merged very recently and is not reviewed by QE, so I don't think we can include this tomorrow.
  4. Marian Kucharcik 2015-11-11

    Thanks Kota, I'm looking forward to next release that fixes this and another windows phone bugs...
  5. Marian Kucharcik 2015-11-13

    Hello Kota, may I ask you when will be next release available? I read that at 11.11 was planned to release new version, but even today I haven't any updates available. I'm looking forward for this, because I develop multiplatform application and that release suppose to include many bug fixes for WP platform. Thank you.
  6. Kota Iguchi 2015-11-13

    For now it's scheduled to release at 5.2.0, but I don't know exactly when it will be released...I would suggest trying out our very latest "[Continuous Builds](http://builds.appcelerator.com.s3.amazonaws.com/index.html#master)" version in case you need the update asap. (FYI [Installing Titanium SDK Continuous Builds](http://docs.appcelerator.com/platform/latest/#!/guide/Installing_Titanium_SDK_Continuous_Builds-section-29004843_InstallingTitaniumSDKContinuousBuilds-ManualInstall)). I think it's useful to try CI version because Windows SDK is actively updated, for not only bug fixes but also new APIs.
  7. Marian Kucharcik 2015-11-16

    Hi Kota, I tried to download latest 5.2.0 SDK as you adviced, but problem with getRect() persist. It throws new error: {color:red}Runtime error during postlayout event: invalid vector subscript.{color} If I put that code outside postlayout event listener, it throws error: {color:red}Error while require (/app) invalid vector subscript{color} Thanks
  8. Kota Iguchi 2015-11-17

    [~max87] Could you paste a sample code that reproduces this issue? I tried following but it runs without errors.
       var win = Ti.UI.createWindow();
       var view = Ti.UI.createLabel({ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.' });
       
       win.addEventListener('postlayout', function () {
           Ti.API.info(JSON.stringify(view.getRect()));
       });
       
       win.add(view);
       win.open();
       
  9. Marian Kucharcik 2015-11-17

    Hello Kota, I'm sorry, getRect() is working fine, my error was caused by using Ti.API.log(old habit from iOS/Android) instead of Ti.API.info. Thank you very much for your time and for fix.
  10. Kota Iguchi 2015-11-17

    ok cool. closing.
  11. Lee Morris 2017-03-16

    Closing ticket as fixed.

JSON Source