{"action":"created","issue":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1591","repository_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks","labels_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1591/labels{/name}","comments_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1591/comments","events_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1591/events","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1591","id":198119929,"number":1591,"title":"Preview Libraries Before Importing","user":{"login":"cycomachead","id":1505907,"avatar_url":"https://avatars.githubusercontent.com/u/1505907?v=3","gravatar_id":"","url":"https://api.github.com/users/cycomachead","html_url":"https://github.com/cycomachead","followers_url":"https://api.github.com/users/cycomachead/followers","following_url":"https://api.github.com/users/cycomachead/following{/other_user}","gists_url":"https://api.github.com/users/cycomachead/gists{/gist_id}","starred_url":"https://api.github.com/users/cycomachead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cycomachead/subscriptions","organizations_url":"https://api.github.com/users/cycomachead/orgs","repos_url":"https://api.github.com/users/cycomachead/repos","events_url":"https://api.github.com/users/cycomachead/events{/privacy}","received_events_url":"https://api.github.com/users/cycomachead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-30T08:43:48Z","updated_at":"2016-12-30T20:31:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1591","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1591","diff_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1591.diff","patch_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1591.patch"},"body":"So, the libraries menu is getting a bit untenable for me, and the names are no longer helpful to what the libraries do / contain.\r\n\r\nThis creates a dialog that lets you preview a library before importing. There's a couple minor bugs, and I need to update the library descriptions, but code is basically ready.\r\n\r\nhttp://cycomachead.github.io/snap/ to play with it.\r\n\r\nScreenshots:\r\n![screen shot 2016-12-30 at 12 13 31 am](https://cloud.githubusercontent.com/assets/1505907/21561975/e9a8331a-ce28-11e6-88eb-17c242bdd392.png)\r\nThis isn't how things should be, but I'm not sure I understand why...\r\n![screen shot 2016-12-30 at 12 37 24 am](https://cloud.githubusercontent.com/assets/1505907/21561976/e9dc6c48-ce28-11e6-95ab-f6773bf97293.png)\r\n\r\n![screen shot 2016-12-30 at 12 37 52 am](https://cloud.githubusercontent.com/assets/1505907/21561977/e9e17486-ce28-11e6-9289-d2cd49e3dea8.png)"},"comment":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/comments/269818562","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1591#issuecomment-269818562","issue_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1591","id":269818562,"user":{"login":"cycomachead","id":1505907,"avatar_url":"https://avatars.githubusercontent.com/u/1505907?v=3","gravatar_id":"","url":"https://api.github.com/users/cycomachead","html_url":"https://github.com/cycomachead","followers_url":"https://api.github.com/users/cycomachead/followers","following_url":"https://api.github.com/users/cycomachead/following{/other_user}","gists_url":"https://api.github.com/users/cycomachead/gists{/gist_id}","starred_url":"https://api.github.com/users/cycomachead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cycomachead/subscriptions","organizations_url":"https://api.github.com/users/cycomachead/orgs","repos_url":"https://api.github.com/users/cycomachead/repos","events_url":"https://api.github.com/users/cycomachead/events{/privacy}","received_events_url":"https://api.github.com/users/cycomachead/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T20:31:18Z","updated_at":"2016-12-30T20:31:18Z","body":"Oh thanks hardmath!\nThat sorta makes sense I guess and I feel like that's the more \"intended\" method than directly calling drawImage. \n\nSadly reordering my calls was not one of the permutations I tried but I'm glad it's an easy fix. :)\n-- \nMichael Ball\nFrom my iPhone\nmichaelball.co\n\n> On Dec 30, 2016, at 10:05 AM, Hardmath123 <notifications@github.com> wrote:\n> \n> @Hardmath123 commented on this pull request.\n> \n> In gui.js:\n> \n> > +    x = this.palette.left() + padding;\n> +    y = this.palette.top();\n> +    SpriteMorph.prototype.categories.forEach(function (category) {\n> +        blocksList.forEach(function (definition, idx) {\n> +            if (definition.category !== category) {return; }\n> +            if (category !== previousCategory) {\n> +                y += padding;\n> +            }\n> +            \n> +            previousCategory = category;\n> +            blockImage = definition.templateInstance().fullImage();\n> +            blockContainer = new Morph();\n> +            blockContainer.contents = blockImage;\n> +            blockContainer.image = blockImage;\n> +            blockContainer.setPosition(new Point(x, y));\n> +            blockContainer.setExtent(\n> Ah, this has happened to me before. The solution was to set the extent before setting the image (i.e. move these three lines up before line 6477).\n> \n> \n> diff --git a/gui.js b/gui.js\n> index 140e2da..e9289ac 100644\n> --- a/gui.js\n> +++ b/gui.js\n> @@ -6474,12 +6474,12 @@ LibraryImportDialogMorph.prototype.displayBlocks = function (libraryKey) {\n>              previousCategory = category;\n>              blockImage = definition.templateInstance().fullImage();\n>              blockContainer = new Morph();\n> -            blockContainer.contents = blockImage;\n> -            blockContainer.image = blockImage;\n> -            blockContainer.setPosition(new Point(x, y));\n>              blockContainer.setExtent(\n>                  new Point(blockImage.width, blockImage.height)\n>              );\n> +            blockContainer.contents = blockImage;\n> +            blockContainer.image = blockImage;\n> +            blockContainer.setPosition(new Point(x, y));\n>              myself.palette.add(blockContainer);\n>              y += blockContainer.fullBounds().height() + padding;\n>              blocksList.pop(idx);\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"cycomachead"}}