{"action":"created","comment":{"url":"https://api.github.com/repos/playcanvas/engine/pulls/comments/171404335","pull_request_review_id":100250839,"id":171404335,"diff_hunk":"@@ -225,6 +232,47 @@ pc.extend(pc, function () {\n                 this._model.meshInstances.splice(idx, 1);\n         },\n \n+        _setMaterial: function (material) {\n+            this._material = material;\n+            if (this._model) {\n+                for (var i = 0, len = this._model.meshInstances.length; i<len; i++) {\n+                    var mi = this._model.meshInstances[i];\n+                    mi.material = material;\n+                }\n+            }\n+        },\n+\n+        _setMaskedBy: function (mask) {\n+            if (mask) {\n+                if (this._maskedBy && this._maskedBy !== mask) {\n+                    // already masked by something else\n+                }\n+\n+                var ref = mask.element._image._maskRef;\n+\n+                this._maskParams = new pc.StencilParameters({\n+                    ref: ref,\n+                    func: pc.FUNC_EQUAL,\n+                });\n+\n+                for (var i = 0, len = this._model.meshInstances.length; i<len; i++) {\n+                    var mi = this._model.meshInstances[i];\n+                    mi.stencilFront = mi.stencilBack = this._maskParams;\n+                }\n+                this._maskedBy = mask;\n+            } else {\n+                // remove mask\n+                if (this._maskedBy) {\n+                    for (var i = 0, len = this._model.meshInstances.length; i<len; i++) {\n+                        var mi = this._model.meshInstances[i];","path":"src/framework/components/element/text-element.js","position":57,"original_position":57,"commit_id":"5a229a7c559556eff44f6f2cdee3eb0b5942cac4","original_commit_id":"5a229a7c559556eff44f6f2cdee3eb0b5942cac4","user":{"login":"willeastcott","id":697563,"avatar_url":"https://avatars0.githubusercontent.com/u/697563?v=4","gravatar_id":"","url":"https://api.github.com/users/willeastcott","html_url":"https://github.com/willeastcott","followers_url":"https://api.github.com/users/willeastcott/followers","following_url":"https://api.github.com/users/willeastcott/following{/other_user}","gists_url":"https://api.github.com/users/willeastcott/gists{/gist_id}","starred_url":"https://api.github.com/users/willeastcott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willeastcott/subscriptions","organizations_url":"https://api.github.com/users/willeastcott/orgs","repos_url":"https://api.github.com/users/willeastcott/repos","events_url":"https://api.github.com/users/willeastcott/events{/privacy}","received_events_url":"https://api.github.com/users/willeastcott/received_events","type":"User","site_admin":false},"body":"Redeclaration of mi. Put at start of function.","created_at":"2018-02-28T22:19:38Z","updated_at":"2018-02-28T22:26:55Z","html_url":"https://github.com/playcanvas/engine/pull/1118#discussion_r171404335","pull_request_url":"https://api.github.com/repos/playcanvas/engine/pulls/1118","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/comments/171404335"},"html":{"href":"https://github.com/playcanvas/engine/pull/1118#discussion_r171404335"},"pull_request":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/1118"}}},"pull_request":{"url":"https://api.github.com/repos/playcanvas/engine/pulls/1118","id":172075381,"html_url":"https://github.com/playcanvas/engine/pull/1118","diff_url":"https://github.com/playcanvas/engine/pull/1118.diff","patch_url":"https://github.com/playcanvas/engine/pull/1118.patch","issue_url":"https://api.github.com/repos/playcanvas/engine/issues/1118","number":1118,"state":"open","locked":false,"title":"UI masks per mesh instance","user":{"login":"daredevildave","id":504980,"avatar_url":"https://avatars3.githubusercontent.com/u/504980?v=4","gravatar_id":"","url":"https://api.github.com/users/daredevildave","html_url":"https://github.com/daredevildave","followers_url":"https://api.github.com/users/daredevildave/followers","following_url":"https://api.github.com/users/daredevildave/following{/other_user}","gists_url":"https://api.github.com/users/daredevildave/gists{/gist_id}","starred_url":"https://api.github.com/users/daredevildave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daredevildave/subscriptions","organizations_url":"https://api.github.com/users/daredevildave/orgs","repos_url":"https://api.github.com/users/daredevildave/repos","events_url":"https://api.github.com/users/daredevildave/events{/privacy}","received_events_url":"https://api.github.com/users/daredevildave/received_events","type":"User","site_admin":false},"body":"Add \"mask\" property to image elements which disables visible rendering of the image element and instead masks child elements by the rect (if no texture) or alpha channel (if textured). Masked elements are only visible inside the masked area.","created_at":"2018-02-28T21:18:37Z","updated_at":"2018-02-28T22:26:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94f57b32072b64021a469f27d16bd76a1424eb8f","assignee":null,"assignees":[],"requested_reviewers":[{"login":"guycalledfrank","id":7008423,"avatar_url":"https://avatars1.githubusercontent.com/u/7008423?v=4","gravatar_id":"","url":"https://api.github.com/users/guycalledfrank","html_url":"https://github.com/guycalledfrank","followers_url":"https://api.github.com/users/guycalledfrank/followers","following_url":"https://api.github.com/users/guycalledfrank/following{/other_user}","gists_url":"https://api.github.com/users/guycalledfrank/gists{/gist_id}","starred_url":"https://api.github.com/users/guycalledfrank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guycalledfrank/subscriptions","organizations_url":"https://api.github.com/users/guycalledfrank/orgs","repos_url":"https://api.github.com/users/guycalledfrank/repos","events_url":"https://api.github.com/users/guycalledfrank/events{/privacy}","received_events_url":"https://api.github.com/users/guycalledfrank/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":156181610,"url":"https://api.github.com/repos/playcanvas/engine/labels/feature%20request","name":"feature request","color":"009800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/playcanvas/engine/pulls/1118/commits","review_comments_url":"https://api.github.com/repos/playcanvas/engine/pulls/1118/comments","review_comment_url":"https://api.github.com/repos/playcanvas/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/playcanvas/engine/issues/1118/comments","statuses_url":"https://api.github.com/repos/playcanvas/engine/statuses/5a229a7c559556eff44f6f2cdee3eb0b5942cac4","head":{"label":"playcanvas:ui-masks-per-mesh-instance","ref":"ui-masks-per-mesh-instance","sha":"5a229a7c559556eff44f6f2cdee3eb0b5942cac4","user":{"login":"playcanvas","id":1030579,"avatar_url":"https://avatars0.githubusercontent.com/u/1030579?v=4","gravatar_id":"","url":"https://api.github.com/users/playcanvas","html_url":"https://github.com/playcanvas","followers_url":"https://api.github.com/users/playcanvas/followers","following_url":"https://api.github.com/users/playcanvas/following{/other_user}","gists_url":"https://api.github.com/users/playcanvas/gists{/gist_id}","starred_url":"https://api.github.com/users/playcanvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playcanvas/subscriptions","organizations_url":"https://api.github.com/users/playcanvas/orgs","repos_url":"https://api.github.com/users/playcanvas/repos","events_url":"https://api.github.com/users/playcanvas/events{/privacy}","received_events_url":"https://api.github.com/users/playcanvas/received_events","type":"Organization","site_admin":false},"repo":{"id":19696006,"name":"engine","full_name":"playcanvas/engine","owner":{"login":"playcanvas","id":1030579,"avatar_url":"https://avatars0.githubusercontent.com/u/1030579?v=4","gravatar_id":"","url":"https://api.github.com/users/playcanvas","html_url":"https://github.com/playcanvas","followers_url":"https://api.github.com/users/playcanvas/followers","following_url":"https://api.github.com/users/playcanvas/following{/other_user}","gists_url":"https://api.github.com/users/playcanvas/gists{/gist_id}","starred_url":"https://api.github.com/users/playcanvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playcanvas/subscriptions","organizations_url":"https://api.github.com/users/playcanvas/orgs","repos_url":"https://api.github.com/users/playcanvas/repos","events_url":"https://api.github.com/users/playcanvas/events{/privacy}","received_events_url":"https://api.github.com/users/playcanvas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/playcanvas/engine","description":"JavaScript game engine built on WebGL and WebVR.","fork":false,"url":"https://api.github.com/repos/playcanvas/engine","forks_url":"https://api.github.com/repos/playcanvas/engine/forks","keys_url":"https://api.github.com/repos/playcanvas/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/playcanvas/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/playcanvas/engine/teams","hooks_url":"https://api.github.com/repos/playcanvas/engine/hooks","issue_events_url":"https://api.github.com/repos/playcanvas/engine/issues/events{/number}","events_url":"https://api.github.com/repos/playcanvas/engine/events","assignees_url":"https://api.github.com/repos/playcanvas/engine/assignees{/user}","branches_url":"https://api.github.com/repos/playcanvas/engine/branches{/branch}","tags_url":"https://api.github.com/repos/playcanvas/engine/tags","blobs_url":"https://api.github.com/repos/playcanvas/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/playcanvas/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/playcanvas/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/playcanvas/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/playcanvas/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/playcanvas/engine/languages","stargazers_url":"https://api.github.com/repos/playcanvas/engine/stargazers","contributors_url":"https://api.github.com/repos/playcanvas/engine/contributors","subscribers_url":"https://api.github.com/repos/playcanvas/engine/subscribers","subscription_url":"https://api.github.com/repos/playcanvas/engine/subscription","commits_url":"https://api.github.com/repos/playcanvas/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/playcanvas/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/playcanvas/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/playcanvas/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/playcanvas/engine/contents/{+path}","compare_url":"https://api.github.com/repos/playcanvas/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/playcanvas/engine/merges","archive_url":"https://api.github.com/repos/playcanvas/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/playcanvas/engine/downloads","issues_url":"https://api.github.com/repos/playcanvas/engine/issues{/number}","pulls_url":"https://api.github.com/repos/playcanvas/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/playcanvas/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/playcanvas/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/playcanvas/engine/labels{/name}","releases_url":"https://api.github.com/repos/playcanvas/engine/releases{/id}","deployments_url":"https://api.github.com/repos/playcanvas/engine/deployments","created_at":"2014-05-12T11:24:30Z","updated_at":"2018-02-28T05:52:46Z","pushed_at":"2018-02-28T21:25:23Z","git_url":"git://github.com/playcanvas/engine.git","ssh_url":"git@github.com:playcanvas/engine.git","clone_url":"https://github.com/playcanvas/engine.git","svn_url":"https://github.com/playcanvas/engine","homepage":"https://playcanvas.com/","size":51898,"stargazers_count":3262,"watchers_count":3262,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":610,"mirror_url":null,"archived":false,"open_issues_count":153,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":610,"open_issues":153,"watchers":3262,"default_branch":"master"}},"base":{"label":"playcanvas:master","ref":"master","sha":"a4289bf0f0d772f8f7f09bbb9416b5296df538ed","user":{"login":"playcanvas","id":1030579,"avatar_url":"https://avatars0.githubusercontent.com/u/1030579?v=4","gravatar_id":"","url":"https://api.github.com/users/playcanvas","html_url":"https://github.com/playcanvas","followers_url":"https://api.github.com/users/playcanvas/followers","following_url":"https://api.github.com/users/playcanvas/following{/other_user}","gists_url":"https://api.github.com/users/playcanvas/gists{/gist_id}","starred_url":"https://api.github.com/users/playcanvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playcanvas/subscriptions","organizations_url":"https://api.github.com/users/playcanvas/orgs","repos_url":"https://api.github.com/users/playcanvas/repos","events_url":"https://api.github.com/users/playcanvas/events{/privacy}","received_events_url":"https://api.github.com/users/playcanvas/received_events","type":"Organization","site_admin":false},"repo":{"id":19696006,"name":"engine","full_name":"playcanvas/engine","owner":{"login":"playcanvas","id":1030579,"avatar_url":"https://avatars0.githubusercontent.com/u/1030579?v=4","gravatar_id":"","url":"https://api.github.com/users/playcanvas","html_url":"https://github.com/playcanvas","followers_url":"https://api.github.com/users/playcanvas/followers","following_url":"https://api.github.com/users/playcanvas/following{/other_user}","gists_url":"https://api.github.com/users/playcanvas/gists{/gist_id}","starred_url":"https://api.github.com/users/playcanvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/playcanvas/subscriptions","organizations_url":"https://api.github.com/users/playcanvas/orgs","repos_url":"https://api.github.com/users/playcanvas/repos","events_url":"https://api.github.com/users/playcanvas/events{/privacy}","received_events_url":"https://api.github.com/users/playcanvas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/playcanvas/engine","description":"JavaScript game engine built on WebGL and WebVR.","fork":false,"url":"https://api.github.com/repos/playcanvas/engine","forks_url":"https://api.github.com/repos/playcanvas/engine/forks","keys_url":"https://api.github.com/repos/playcanvas/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/playcanvas/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/playcanvas/engine/teams","hooks_url":"https://api.github.com/repos/playcanvas/engine/hooks","issue_events_url":"https://api.github.com/repos/playcanvas/engine/issues/events{/number}","events_url":"https://api.github.com/repos/playcanvas/engine/events","assignees_url":"https://api.github.com/repos/playcanvas/engine/assignees{/user}","branches_url":"https://api.github.com/repos/playcanvas/engine/branches{/branch}","tags_url":"https://api.github.com/repos/playcanvas/engine/tags","blobs_url":"https://api.github.com/repos/playcanvas/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/playcanvas/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/playcanvas/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/playcanvas/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/playcanvas/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/playcanvas/engine/languages","stargazers_url":"https://api.github.com/repos/playcanvas/engine/stargazers","contributors_url":"https://api.github.com/repos/playcanvas/engine/contributors","subscribers_url":"https://api.github.com/repos/playcanvas/engine/subscribers","subscription_url":"https://api.github.com/repos/playcanvas/engine/subscription","commits_url":"https://api.github.com/repos/playcanvas/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/playcanvas/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/playcanvas/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/playcanvas/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/playcanvas/engine/contents/{+path}","compare_url":"https://api.github.com/repos/playcanvas/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/playcanvas/engine/merges","archive_url":"https://api.github.com/repos/playcanvas/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/playcanvas/engine/downloads","issues_url":"https://api.github.com/repos/playcanvas/engine/issues{/number}","pulls_url":"https://api.github.com/repos/playcanvas/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/playcanvas/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/playcanvas/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/playcanvas/engine/labels{/name}","releases_url":"https://api.github.com/repos/playcanvas/engine/releases{/id}","deployments_url":"https://api.github.com/repos/playcanvas/engine/deployments","created_at":"2014-05-12T11:24:30Z","updated_at":"2018-02-28T05:52:46Z","pushed_at":"2018-02-28T21:25:23Z","git_url":"git://github.com/playcanvas/engine.git","ssh_url":"git@github.com:playcanvas/engine.git","clone_url":"https://github.com/playcanvas/engine.git","svn_url":"https://github.com/playcanvas/engine","homepage":"https://playcanvas.com/","size":51898,"stargazers_count":3262,"watchers_count":3262,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":610,"mirror_url":null,"archived":false,"open_issues_count":153,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":610,"open_issues":153,"watchers":3262,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/1118"},"html":{"href":"https://github.com/playcanvas/engine/pull/1118"},"issue":{"href":"https://api.github.com/repos/playcanvas/engine/issues/1118"},"comments":{"href":"https://api.github.com/repos/playcanvas/engine/issues/1118/comments"},"review_comments":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/1118/comments"},"review_comment":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/playcanvas/engine/pulls/1118/commits"},"statuses":{"href":"https://api.github.com/repos/playcanvas/engine/statuses/5a229a7c559556eff44f6f2cdee3eb0b5942cac4"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"willeastcott"}}