Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set viewWidth in RTTBufferManager sets height instead of width #279

Closed
genesys-zz opened this issue Jun 9, 2012 · 0 comments
Closed

set viewWidth in RTTBufferManager sets height instead of width #279

genesys-zz opened this issue Jun 9, 2012 · 0 comments
Assignees
Labels

Comments

@genesys-zz
Copy link

the function set viewWidth has a bug in the branch when _textureWidth is not larger than _viewWidth. it then sets the height of the _renderToTextureRect instead of the width:

    public function set viewWidth(value : int) : void
    {
        if (value == _viewWidth) return;
        _viewWidth = value;

        _buffersInvalid = true;

        _textureWidth = TextureUtils.getBestPowerOf2(_viewWidth);

        if (_textureWidth > _viewWidth) {
            _renderToTextureRect.x = uint((_textureWidth-_viewWidth)*.5);
            _renderToTextureRect.width = _viewWidth;
        }
        else {
            _renderToTextureRect.x = 0;
            _renderToTextureRect.height = _textureHeight;
        }
        dispatchEvent(new Event(Event.RESIZE));
    }

_renderToTextureRect.height = _textureHeight;

must be replaced with

_renderToTextureRect.width = _textureWidth;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants