On VENU 2 with firmware 13.14 dc.getTextWidthInPixels doesn't work correctly after function onSettingsChanged()

It works correctly in first time, but after OnSettingsChanged it doesn't work

$.dc2 has :getTextWidthInPixels =true before and after is good but when you call 

TgetTextWidthInPixels= $.dc2.getTextWidthInPixels("88", 3); it crashes with  Error Name: Invalid Value
several other devices has same issue
Devices:
Venu® Sq 2: 2.47
Venu® 2S: 13.14
Upcoming Wearable: 13.14
Forerunner® 255 Music: 15.19
Forerunner® 955 / Solar: 15.19

Top Replies

All Replies

  • All is good on simulator, but on device, if 

    OnSettingsChanged , you get dc.getTextWidthInPixels, you have a crash.

    When you reselect the face, the change is effective

    All is good on standard mode

  • getTextWidthInPixels was crashing for me when I made the mistake of copying the DC and trying to use it later. It appears that the DC is only valid when it is passed as a parameter in the refresh() function. Keeping a copy of it worked before in older versions of the SDK though.

  • Yeah, the "$.dc2" part of the error message suggests that OP has stored a copy of the DC for later use. I wouldn't do this as it's pretty obvious from the design of CIQ that you're only supposed to access a DC that's passed into one of the standard callback functions, such as onLayout() or onUpdate().

    (It may have worked before, but it's not a good idea to rely on non-standard behavior.)