diff options
author | 2011-11-16 12:22:10 -0800 | |
---|---|---|
committer | 2011-11-16 12:22:10 -0800 | |
commit | 2d8ef49914595f3f1df42fed0a9ae68777ff9411 (patch) | |
tree | a7bd41b3a01cb9a824056fc04972ddb72e88ee31 /libs/rs/rsFont.cpp | |
parent | 7b95eba9f47a3992128d59a9ec593b887e4dac0e (diff) |
Fixing FBO font rendering bug that resulted from using old surface size.
Change-Id: I31d0967bb36ca6ffb6a4c8194597d3c523cfe954
Diffstat (limited to 'libs/rs/rsFont.cpp')
-rw-r--r-- | libs/rs/rsFont.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 7efed9d9f948..81b96af685f4 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/rsFont.cpp @@ -654,11 +654,7 @@ void FontState::appendMeshQuad(float x1, float y1, float z1, const uint32_t floatsPerVert = 5; float *currentPos = mTextMeshPtr + mCurrentQuadIndex * vertsPerQuad * floatsPerVert; - // Cull things that are off the screen - float width = (float)mRSC->getWidth(); - float height = (float)mRSC->getHeight(); - - if (x1 > width || y1 < 0.0f || x2 < 0 || y4 > height) { + if (x1 > mSurfaceWidth || y1 < 0.0f || x2 < 0 || y4 > mSurfaceHeight) { return; } @@ -746,6 +742,10 @@ void FontState::renderText(const char *text, uint32_t len, int32_t x, int32_t y, return; } + // Cull things that are off the screen + mSurfaceWidth = (float)mRSC->getCurrentSurfaceWidth(); + mSurfaceHeight = (float)mRSC->getCurrentSurfaceHeight(); + currentFont->renderUTF(text, len, x, y, startIndex, numGlyphs, mode, bounds, bitmap, bitmapW, bitmapH); |