{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/Win2D/issues/160","labels_url":"https://api.github.com/repos/Microsoft/Win2D/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/Win2D/issues/160/comments","events_url":"https://api.github.com/repos/Microsoft/Win2D/issues/160/events","html_url":"https://github.com/Microsoft/Win2D/issues/160","id":107260566,"number":160,"title":"VirtualCanvasControl invalidate(Rect) problem with unit pixels","user":{"login":"FabricioCabeca","id":8783307,"avatar_url":"https://avatars.githubusercontent.com/u/8783307?v=3","gravatar_id":"","url":"https://api.github.com/users/FabricioCabeca","html_url":"https://github.com/FabricioCabeca","followers_url":"https://api.github.com/users/FabricioCabeca/followers","following_url":"https://api.github.com/users/FabricioCabeca/following{/other_user}","gists_url":"https://api.github.com/users/FabricioCabeca/gists{/gist_id}","starred_url":"https://api.github.com/users/FabricioCabeca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FabricioCabeca/subscriptions","organizations_url":"https://api.github.com/users/FabricioCabeca/orgs","repos_url":"https://api.github.com/users/FabricioCabeca/repos","events_url":"https://api.github.com/users/FabricioCabeca/events{/privacy}","received_events_url":"https://api.github.com/users/FabricioCabeca/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-18T19:12:49Z","updated_at":"2015-09-18T19:15:05Z","closed_at":null,"body":"Hi, I've been playing with VirtualCanvasControl as a substitute to the CanvasControl so I can use the region invalidate. When using dips it seems to work as expected, but using pixels it may render the wrong source position. Please notice it is not a wrong conversion on my side, when invalidating the whole area everything is drawn where expected.\r\n```\r\nforeach (var region in args.InvalidatedRegions)\r\n{\r\nusing (var ds = sender.CreateDrawingSession(region))\r\n{\r\nds.Units = CanvasUnits.Pixels;\r\ni++;\r\ni %= 100;\r\nds.FillCircle(50 + i, 50, 50, Windows.UI.Colors.Red);\r\nds.Dispose();\r\n//sender.Invalidate();\r\nsender.Invalidate(new Rect(0, 0, 200, 200));\r\n}\r\n}\r\n```\r\nCanvasUnits.Pixels + sender.Invalidate() works\r\nCanvasUnits.Dips + sender.Invalidate(Rect) works\r\nCanvasUnits.Pixels + sender.Invalidate(Rect) does not work as expected\r\n\r\nTested with 1.4.0\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/Microsoft/Win2D/issues/comments/141541120","html_url":"https://github.com/Microsoft/Win2D/issues/160#issuecomment-141541120","issue_url":"https://api.github.com/repos/Microsoft/Win2D/issues/160","id":141541120,"user":{"login":"shawnhar","id":8118468,"avatar_url":"https://avatars.githubusercontent.com/u/8118468?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnhar","html_url":"https://github.com/shawnhar","followers_url":"https://api.github.com/users/shawnhar/followers","following_url":"https://api.github.com/users/shawnhar/following{/other_user}","gists_url":"https://api.github.com/users/shawnhar/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnhar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnhar/subscriptions","organizations_url":"https://api.github.com/users/shawnhar/orgs","repos_url":"https://api.github.com/users/shawnhar/repos","events_url":"https://api.github.com/users/shawnhar/events{/privacy}","received_events_url":"https://api.github.com/users/shawnhar/received_events","type":"User","site_admin":false},"created_at":"2015-09-18T19:15:05Z","updated_at":"2015-09-18T19:15:05Z","body":"This is expected, because the CanvasDrawingSession.Units property only affects the specific CanvasDrawingSession that it was set on  (if you have multiple drawing sessions, it's entirely valid to have different Units on each one).\r\n\r\nInvalidate is a method of CanvasVirtualControl, not CanvasDrawingSession, so it is not affected by the drawing session units.\r\n\r\nInvalidate always operates in dips."}}