mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-20 13:39:22 +00:00
Merge pull request #3199 from daboe01/fixed-textsizing-via-canvas-not-functional-anymore
fixed: canvas text sizing is not functional anymore
This commit is contained in:
1 file changed
+3
-7
@@ -69,13 +69,9 @@ CPCanvasStringSizingIsFunctional = NO;
|
||||
CPStringSizeMeasuringContext = CGBitmapGraphicsContextCreate();
|
||||
|
||||
// This is to make sure that Canvas based string sizing is functional before we use it.
|
||||
// Currently, Chrome has issues with certain strings, FF had issues in the past.
|
||||
// Unfortunately, this test does fit in CPCompatibility.j where things are not sufficiently initialized.
|
||||
|
||||
var testingFont = [CPFont systemFontOfSize:12];
|
||||
var testingText = 'A A A A A A A A';
|
||||
CPStringSizeMeasuringContext.font = [testingFont cssString];
|
||||
CPCanvasStringSizingIsFunctional = ROUND(CPStringSizeMeasuringContext.measureText(testingText).width) == ROUND([CPPlatformString sizeOfString:testingText withFont:testingFont forWidth:NULL].width);
|
||||
// Unfortunately, as of today canvas sizing is not funtional any more. Neither in Chrome nor in FF
|
||||
|
||||
CPCanvasStringSizingIsFunctional = NO;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user