{"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/3145","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/3145/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/3145/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/3145/events","html_url":"https://github.com/libgdx/libgdx/issues/3145","id":77964009,"number":3145,"title":"Is it correct that draw(Texture) behaves differently than draw(TextureRegion)?","user":{"login":"btd-f-lago","id":6994255,"avatar_url":"https://avatars.githubusercontent.com/u/6994255?v=3","gravatar_id":"","url":"https://api.github.com/users/btd-f-lago","html_url":"https://github.com/btd-f-lago","followers_url":"https://api.github.com/users/btd-f-lago/followers","following_url":"https://api.github.com/users/btd-f-lago/following{/other_user}","gists_url":"https://api.github.com/users/btd-f-lago/gists{/gist_id}","starred_url":"https://api.github.com/users/btd-f-lago/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btd-f-lago/subscriptions","organizations_url":"https://api.github.com/users/btd-f-lago/orgs","repos_url":"https://api.github.com/users/btd-f-lago/repos","events_url":"https://api.github.com/users/btd-f-lago/events{/privacy}","received_events_url":"https://api.github.com/users/btd-f-lago/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-19T06:51:00Z","updated_at":"2015-05-19T17:09:46Z","closed_at":"2015-05-19T17:09:46Z","body":"I stumbled across something I would consider weird:\r\n\r\nDrawing a texture region with:\r\npublic void draw (TextureRegion region, float x, float y, float originX, float originY, float width, float height,\r\n\t\tfloat scaleX, float scaleY, float rotation)\r\n\r\nbehaves differently from:\r\npublic void draw (Texture texture, float x, float y, int srcX, int srcY, int srcWidth, int srcHeight)\r\n\r\ncalled with region.getTexture(), same x,y, region.getRegionOriginX(), region.getRegionOriginY(), same width and height parameters.\r\n\r\nThe former was called with scaleX = 1.0f, scaleY = 1.0f and rotation = 0.\r\n\r\nWhen called with a very small width (5 or 10 pixels) the drawn image shifts to the left by a few pixels, as the width gets closer to the actual region width, the problem gradually disappears.\r\n\r\nI was wondering if this might be a bug due to float point math in the rotation matrix, but I'd expect it still to be smaller than one pixel.\r\nI can't seem to find a clear problem with the code though, I was wondering if anyone had experienced the same problem."},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/103595788","html_url":"https://github.com/libgdx/libgdx/issues/3145#issuecomment-103595788","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/3145","id":103595788,"user":{"login":"xoppa","id":2349087,"avatar_url":"https://avatars.githubusercontent.com/u/2349087?v=3","gravatar_id":"","url":"https://api.github.com/users/xoppa","html_url":"https://github.com/xoppa","followers_url":"https://api.github.com/users/xoppa/followers","following_url":"https://api.github.com/users/xoppa/following{/other_user}","gists_url":"https://api.github.com/users/xoppa/gists{/gist_id}","starred_url":"https://api.github.com/users/xoppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xoppa/subscriptions","organizations_url":"https://api.github.com/users/xoppa/orgs","repos_url":"https://api.github.com/users/xoppa/repos","events_url":"https://api.github.com/users/xoppa/events{/privacy}","received_events_url":"https://api.github.com/users/xoppa/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T17:09:46Z","updated_at":"2015-05-19T17:09:46Z","body":"This is an issue tracker, please use the forum or irc instead. https://github.com/libgdx/libgdx/blob/master/CONTRIBUTING.md#using-the-issue-tracker. "}}