Fixed origin addition post-scale

This commit is contained in:
Richard Davey 2018-07-09 16:17:52 +01:00
parent 91a48c30c4
commit a3803a286f
2 changed files with 7 additions and 3 deletions

View file

@ -136,6 +136,7 @@ There is a new Game Object Component called `TextureCrop`. It replaces the Textu
* `clearMask(true)` would throw an exception if the Game Object didn't have a mask. Now it checks first before destroying the mask. Fix #3809 (thanks @NokFrt)
* In the WebGL `GeometryMask` the stencil has been changed from `INVERT` to `KEEP` in order to fix issues when masking Graphics objects and other complex objects. Fix #3807. This also fixes the issue where children in Containers would display incorrectly outside of a Geometry mask. Fix #3746 (thanks @zilbuz @oklar)
* `BitmapMask.destroy` will now remove the textures and framebuffers that it created from the WebGL Renderer as part of the destroy process. Fix #3771 (thanks @nunof07)
* The `BitmapText` WebGL Renderer incorrectly calculated the font scale at very small sizes, causing characters to overlap when they shouldn't. Scale is now applied to the correct component parts in the render code.
### Examples, Documentation and TypeScript

View file

@ -123,8 +123,8 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
glyphW = glyph.width;
glyphH = glyph.height;
var x = (glyph.xOffset + xAdvance) - src.displayOriginX;
var y = (glyph.yOffset + yAdvance) - src.displayOriginY;
var x = glyph.xOffset + xAdvance;
var y = glyph.yOffset + yAdvance;
if (lastGlyph !== null)
{
@ -145,6 +145,9 @@ var BitmapTextWebGLRenderer = function (renderer, src, interpolationPercentage,
x *= scale;
y *= scale;
x -= src.displayOriginX;
y -= src.displayOriginY;
var u0 = glyphX / textureWidth;
var v0 = glyphY / textureHeight;
var u1 = (glyphX + glyphW) / textureWidth;