You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using some special character like '\b' will cause Cesium Broken.
I found that the problem may be at file /Source/Core/writeTextToCanvas.js L46
varascent,descent;// Find the number of rows (from the top) until the first non-white pixelfor(i=0;i<length;++i){if(pixelData[i]!==255){ascent=(i/width4)|0;break;}}// Find the number of rows (from the bottom) until the first non-white pixelfor(i=length-1;i>=0;--i){if(pixelData[i]!==255){descent=(i/width4)|0;break;}}varminx=-1;// For each column, for each row, check for first non-white pixelfor(i=0;i<width&&minx===-1;++i){for(j=0;j<height;++j){varpixelIndex=i*4+j*width4;if(pixelData[pixelIndex]!==255||pixelData[pixelIndex+1]!==255||pixelData[pixelIndex+2]!==255||pixelData[pixelIndex+3]!==255){minx=i;break;}}}return{width: metrics.width,height: descent-ascent,ascent: baseline-ascent,descent: descent-baseline,minx: minx-padding/2,};
We DID NOT initialize ascent and descent as a normal number. When length is equal to 0, the value of ascent and descent would be undefined.
And we will return a object just like:
{
height: NaN,ascent: NaN,descent: NaN
}
That would cause Cesium broken.
The text was updated successfully, but these errors were encountered:
Sandcastle example: https://sandcastle.cesium.com/#c=bZCxboMwEIZf5cQSkJCdNBshqBIdK3Vo1cmLgSO1amxkH6S0yrvXQCNVbTbf5/87/bpROhgVntHBEQyeoUSvho69LiwWUb3MpTUklUEnouQgjDC1NZ4Ag7TaDA0pUuiZbJr4SxiA3vpArMmuO0vpKLyk2bPW2e4BTw7Rx9sUtkk6G1pWqDNYbADCD8pgI0S1u9tvVsb5FV/ZJZiXudNPj1ZPLzbG5BClUe5p0lisKsC96nrrCAanY8Y4YddrGRrxaqjfkVjt/bxojub8t5o3agTVHG9cA2otvQ8/7aD1s/pEERU5D/l/qrayUeb0NKLTcppjb7vicYWMsZyH8bZJ1upKuj+bvwE
Browser: Chrome 96.0.4664.55
Operating System: macOS 11.6
Using some special character like '\b' will cause Cesium Broken.
I found that the problem may be at file
/Source/Core/writeTextToCanvas.js
L46We DID NOT initialize
ascent
anddescent
as a normal number. Whenlength
is equal to 0, the value ofascent
anddescent
would beundefined
.And we will return a object just like:
That would cause Cesium broken.
The text was updated successfully, but these errors were encountered: