{"action":"created","issue":{"url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/2","repository_url":"https://api.github.com/repos/GimmickNG/AIRDock","labels_url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/2/comments","events_url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/2/events","html_url":"https://github.com/GimmickNG/AIRDock/issues/2","id":306550976,"number":2,"title":"Should containers mask subcontainers within their bounds?","user":{"login":"GimmickNG","id":9390648,"avatar_url":"https://avatars3.githubusercontent.com/u/9390648?v=4","gravatar_id":"","url":"https://api.github.com/users/GimmickNG","html_url":"https://github.com/GimmickNG","followers_url":"https://api.github.com/users/GimmickNG/followers","following_url":"https://api.github.com/users/GimmickNG/following{/other_user}","gists_url":"https://api.github.com/users/GimmickNG/gists{/gist_id}","starred_url":"https://api.github.com/users/GimmickNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GimmickNG/subscriptions","organizations_url":"https://api.github.com/users/GimmickNG/orgs","repos_url":"https://api.github.com/users/GimmickNG/repos","events_url":"https://api.github.com/users/GimmickNG/events{/privacy}","received_events_url":"https://api.github.com/users/GimmickNG/received_events","type":"User","site_admin":false},"labels":[{"id":861523419,"url":"https://api.github.com/repos/GimmickNG/AIRDock/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":861523425,"url":"https://api.github.com/repos/GimmickNG/AIRDock/labels/question","name":"question","color":"d876e3","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T17:05:57Z","updated_at":"2018-03-30T11:00:34Z","closed_at":null,"author_association":"OWNER","body":"As it stands, containers are not required to mask their contents within their bounds. Because of this, adding a large sprite to a panel and attaching that panel to a container will result in overlapping of the sprite and other panels which are part of the container.\r\n\r\nA solution to this is to have two masks created, one for each side (currentSide and otherSide), with respect to the parent container; that way, the panels do not have to have masks added to them (one sprite can have one mask, and one mask can only be applied to one sprite) and so only _2n_ masks may be needed (where _n_ is the number of containers with subcontainers below them).\r\n\r\nAn alternative is to not expect containers to fulfil this responsibility, and instead leave it to the panel creators / IPanel implementations (not counting the default) in order to mask their contents within their bounds, or for custom IContainer implementations to be created with masks attached to their subcontainers. This would involve more work on the side of the developer, but would result in less \"cluttering\" in the default implementations, due to less assumptions required by other classes working with the default container implementations.\r\n\r\nA third alternative is to use a separate flag, say _useMask_, within the default ContainerConfig class and have it be transparent to every other class in the rest of the library; the only problem with this is that the _useMask_ property may be unnecessary for most other ContainerConfig instances, especially custom implementations which may not bother using a mask. For this, maybe spinning off ContainerConfig into an interface by itself, instead of a class, may be a better option too.\r\n\r\nWhich of the above is the \"best\" option? (There may be no right or wrong option, since it seems to be a low-priority design/aesthetic issue)"},"comment":{"url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/comments/377502141","html_url":"https://github.com/GimmickNG/AIRDock/issues/2#issuecomment-377502141","issue_url":"https://api.github.com/repos/GimmickNG/AIRDock/issues/2","id":377502141,"user":{"login":"GimmickNG","id":9390648,"avatar_url":"https://avatars3.githubusercontent.com/u/9390648?v=4","gravatar_id":"","url":"https://api.github.com/users/GimmickNG","html_url":"https://github.com/GimmickNG","followers_url":"https://api.github.com/users/GimmickNG/followers","following_url":"https://api.github.com/users/GimmickNG/following{/other_user}","gists_url":"https://api.github.com/users/GimmickNG/gists{/gist_id}","starred_url":"https://api.github.com/users/GimmickNG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GimmickNG/subscriptions","organizations_url":"https://api.github.com/users/GimmickNG/orgs","repos_url":"https://api.github.com/users/GimmickNG/repos","events_url":"https://api.github.com/users/GimmickNG/events{/privacy}","received_events_url":"https://api.github.com/users/GimmickNG/received_events","type":"User","site_admin":false},"created_at":"2018-03-30T11:00:34Z","updated_at":"2018-03-30T11:00:34Z","author_association":"OWNER","body":"Another option that was recently explored is using Decorators: creating a _ContainerMask_, for example, which is a wrapper class that adds a mask to its decorating _IContainer_ instance. However, problems with this approach - namely, merging containers and removing containers causes a bit of trouble because of issues arising when the _decorated_ container adds child objects to another _decorated_ container's _decoration_: then, it attempts to add the _decorated_ container's panelList to the _decoration_ class, which causes an error.\r\n\r\nI am not sure whether this is the only issue, or whether it is a sign of more to come; however, I am leaning towards it being the second one, and so have removed decorator classes (if only temporarily) from the experimental branch.\r\n\r\nAnother option is to have a mechanism like DisplayObject.filter - that is, an array of decorations, such as borders, masks, etc., which are executed upon the container at runtime. There is no wrapping, no extending required, but the implementation may be a bit tricky."}}
{"actor":{"display_login":"GimmickNG"}}