{"action":"created","comment":{"url":"https://api.github.com/repos/jahshaka/VR/pulls/comments/189454199","pull_request_review_id":121638740,"id":189454199,"diff_hunk":"@@ -0,0 +1,203 @@\n+#include \"colorcircle.h\"\n+\n+#include <QPainter>\n+#include <QVECTOR2D>\n+#include <qmath.h>\n+#include <QMOUSEEVENT>\n+#include <QSTYLEOPTION>\n+\n+ColorCircle::ColorCircle(QWidget *parent, QColor ic) : QWidget(parent)\n+{\n+\tsetGeometry(4, 4, parent->width() - 4, parent->height() - 4);\n+\tradius = width() / 2 - 4;\n+\tcenterPoint.setX(radius + 4);\n+\tcenterPoint.setY(radius + 4);\n+\tv = 255;\n+\tdrawCircleColorBackground();\n+\trepaint();\n+\n+\tconfigureResetButton();\n+\tsetInitialColor(ic);\n+\tthis->setStyleSheet(\"background-image:url(:/images/bg.png); \");\n+\n+}\n+\n+void ColorCircle::drawSmallCircle(QColor color)\n+{\n+\tqreal theta = qDegreesToRadians((qreal)color.hsvHue() + 90);\n+\tauto sat = color.hsvSaturation() / 255.0f * radius;\n+\tqreal x = sat * qCos(theta) + centerPoint.x();\n+\tqreal y = sat * qSin(theta) + centerPoint.y();\n+\tQPoint vector(x, y);\n+\tpos = QPoint(x, y);\n+\tthis->v = color.value();\n+\trepaint();\n+}\n+\n+void ColorCircle::setValueInColor(QColor color)\n+{\n+\tthis->v = color.value();\n+\tcurrentColor = color;\n+\tdrawCircleColorBackground();\n+\trepaint();\n+}\n+\n+void ColorCircle::setInitialColor(QColor ic)\n+{\n+\tinitialColor = ic;\n+\tsetValueInColor(ic);\n+\tdrawSmallCircle(ic);\n+\temit positionChanged(ic);\n+}\n+\n+void ColorCircle::paintEvent(QPaintEvent *event)\n+{\n+\tQStyleOption opt;\n+\topt.init(this);\n+\tQPainter painter(this);\n+\tpainter.setRenderHint(QPainter::Antialiasing, true);\n+\tpainter.setRenderHint(QPainter::HighQualityAntialiasing, true);\n+\tstyle()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);\n+\tpainter.drawImage(0, 0, *image);\n+\tQColor color1(240, 240, 240);\n+\tQPen pen(color1, 2);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(4, 4, width() - 8, height() - 8);\n+\n+\tif (v < 195)\n+\t\tcolor1 = color1.fromRgb(250, 250, 250);\n+\telse\n+\t\tcolor1 = color1.fromRgb(50, 50, 50);\n+\t// color1.setRgb(0,0,0,250);\n+\tpen.setColor(color1);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(QPoint(pos.x(), pos.y()), 2, 2);\n+\n+\t//draw initial color\n+\tpen.setColor(initialColor);\n+\tpen.setWidth(8);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(resetButton->geometry());\n+\n+\t//draw circle around initial color \n+\tpen.setColor(QColor(250, 250, 250));\n+\tpen.setWidth(2);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(resetButton->geometry().x() - 4, resetButton->geometry().y() - 4, resetButton->geometry().width() + 8, resetButton->geometry().height() + 8);\n+\n+\t//draw current color\n+\tpen.setColor(currentColor);\n+\tpen.setWidth(8);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(7, height() - 15, 8, 8);\n+\n+\t//draw circle around current color\n+\tpen.setColor(QColor(250, 250, 250));\n+\tpen.setWidth(2);\n+\tpainter.setPen(pen);\n+\tpainter.drawEllipse(3, height() - 19, 16, 16);\n+\n+\n+\tQWidget::paintEvent(event);\n+\n+}\n+\n+void ColorCircle::mouseMoveEvent(QMouseEvent *event)\n+{\n+\tQPoint mousePoint = event->pos();\n+\tQVector2D mousePos(mousePoint.x(), mousePoint.y());\n+\tauto centerPos = QVector2D(centerPoint.x(), centerPoint.y());\n+\tauto diff = mousePos - centerPos;\n+\tif (diff.length() > radius) {\n+\t\tdiff = diff.normalized() * radius;\n+\t}","path":"src/widgets/colorcircle.cpp","position":113,"original_position":113,"commit_id":"d90ed142306c58e9163850919b64db252d965c0e","original_commit_id":"d90ed142306c58e9163850919b64db252d965c0e","user":{"login":"iKlsR","id":741363,"avatar_url":"https://avatars0.githubusercontent.com/u/741363?v=4","gravatar_id":"","url":"https://api.github.com/users/iKlsR","html_url":"https://github.com/iKlsR","followers_url":"https://api.github.com/users/iKlsR/followers","following_url":"https://api.github.com/users/iKlsR/following{/other_user}","gists_url":"https://api.github.com/users/iKlsR/gists{/gist_id}","starred_url":"https://api.github.com/users/iKlsR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iKlsR/subscriptions","organizations_url":"https://api.github.com/users/iKlsR/orgs","repos_url":"https://api.github.com/users/iKlsR/repos","events_url":"https://api.github.com/users/iKlsR/events{/privacy}","received_events_url":"https://api.github.com/users/iKlsR/received_events","type":"User","site_admin":false},"body":"Can be one line","created_at":"2018-05-20T08:24:06Z","updated_at":"2018-05-20T08:26:23Z","html_url":"https://github.com/jahshaka/VR/pull/294#discussion_r189454199","pull_request_url":"https://api.github.com/repos/jahshaka/VR/pulls/294","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/comments/189454199"},"html":{"href":"https://github.com/jahshaka/VR/pull/294#discussion_r189454199"},"pull_request":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/294"}}},"pull_request":{"url":"https://api.github.com/repos/jahshaka/VR/pulls/294","id":189214480,"html_url":"https://github.com/jahshaka/VR/pull/294","diff_url":"https://github.com/jahshaka/VR/pull/294.diff","patch_url":"https://github.com/jahshaka/VR/pull/294.patch","issue_url":"https://api.github.com/repos/jahshaka/VR/issues/294","number":294,"state":"open","locked":false,"title":"Color picker","user":{"login":"willroyMyles","id":23746079,"avatar_url":"https://avatars1.githubusercontent.com/u/23746079?v=4","gravatar_id":"","url":"https://api.github.com/users/willroyMyles","html_url":"https://github.com/willroyMyles","followers_url":"https://api.github.com/users/willroyMyles/followers","following_url":"https://api.github.com/users/willroyMyles/following{/other_user}","gists_url":"https://api.github.com/users/willroyMyles/gists{/gist_id}","starred_url":"https://api.github.com/users/willroyMyles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willroyMyles/subscriptions","organizations_url":"https://api.github.com/users/willroyMyles/orgs","repos_url":"https://api.github.com/users/willroyMyles/repos","events_url":"https://api.github.com/users/willroyMyles/events{/privacy}","received_events_url":"https://api.github.com/users/willroyMyles/received_events","type":"User","site_admin":false},"body":"Added and implemented a custom color picker.","created_at":"2018-05-20T01:35:27Z","updated_at":"2018-05-20T08:26:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e58928025af2c510267c46a1dbdca7fcc8ac137d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jahshaka/VR/pulls/294/commits","review_comments_url":"https://api.github.com/repos/jahshaka/VR/pulls/294/comments","review_comment_url":"https://api.github.com/repos/jahshaka/VR/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jahshaka/VR/issues/294/comments","statuses_url":"https://api.github.com/repos/jahshaka/VR/statuses/d90ed142306c58e9163850919b64db252d965c0e","head":{"label":"willroyMyles:colorPicker","ref":"colorPicker","sha":"d90ed142306c58e9163850919b64db252d965c0e","user":{"login":"willroyMyles","id":23746079,"avatar_url":"https://avatars1.githubusercontent.com/u/23746079?v=4","gravatar_id":"","url":"https://api.github.com/users/willroyMyles","html_url":"https://github.com/willroyMyles","followers_url":"https://api.github.com/users/willroyMyles/followers","following_url":"https://api.github.com/users/willroyMyles/following{/other_user}","gists_url":"https://api.github.com/users/willroyMyles/gists{/gist_id}","starred_url":"https://api.github.com/users/willroyMyles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willroyMyles/subscriptions","organizations_url":"https://api.github.com/users/willroyMyles/orgs","repos_url":"https://api.github.com/users/willroyMyles/repos","events_url":"https://api.github.com/users/willroyMyles/events{/privacy}","received_events_url":"https://api.github.com/users/willroyMyles/received_events","type":"User","site_admin":false},"repo":{"id":130517984,"name":"VR","full_name":"willroyMyles/VR","owner":{"login":"willroyMyles","id":23746079,"avatar_url":"https://avatars1.githubusercontent.com/u/23746079?v=4","gravatar_id":"","url":"https://api.github.com/users/willroyMyles","html_url":"https://github.com/willroyMyles","followers_url":"https://api.github.com/users/willroyMyles/followers","following_url":"https://api.github.com/users/willroyMyles/following{/other_user}","gists_url":"https://api.github.com/users/willroyMyles/gists{/gist_id}","starred_url":"https://api.github.com/users/willroyMyles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willroyMyles/subscriptions","organizations_url":"https://api.github.com/users/willroyMyles/orgs","repos_url":"https://api.github.com/users/willroyMyles/repos","events_url":"https://api.github.com/users/willroyMyles/events{/privacy}","received_events_url":"https://api.github.com/users/willroyMyles/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/willroyMyles/VR","description":"Jahshaka VR","fork":true,"url":"https://api.github.com/repos/willroyMyles/VR","forks_url":"https://api.github.com/repos/willroyMyles/VR/forks","keys_url":"https://api.github.com/repos/willroyMyles/VR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/willroyMyles/VR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/willroyMyles/VR/teams","hooks_url":"https://api.github.com/repos/willroyMyles/VR/hooks","issue_events_url":"https://api.github.com/repos/willroyMyles/VR/issues/events{/number}","events_url":"https://api.github.com/repos/willroyMyles/VR/events","assignees_url":"https://api.github.com/repos/willroyMyles/VR/assignees{/user}","branches_url":"https://api.github.com/repos/willroyMyles/VR/branches{/branch}","tags_url":"https://api.github.com/repos/willroyMyles/VR/tags","blobs_url":"https://api.github.com/repos/willroyMyles/VR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/willroyMyles/VR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/willroyMyles/VR/git/refs{/sha}","trees_url":"https://api.github.com/repos/willroyMyles/VR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/willroyMyles/VR/statuses/{sha}","languages_url":"https://api.github.com/repos/willroyMyles/VR/languages","stargazers_url":"https://api.github.com/repos/willroyMyles/VR/stargazers","contributors_url":"https://api.github.com/repos/willroyMyles/VR/contributors","subscribers_url":"https://api.github.com/repos/willroyMyles/VR/subscribers","subscription_url":"https://api.github.com/repos/willroyMyles/VR/subscription","commits_url":"https://api.github.com/repos/willroyMyles/VR/commits{/sha}","git_commits_url":"https://api.github.com/repos/willroyMyles/VR/git/commits{/sha}","comments_url":"https://api.github.com/repos/willroyMyles/VR/comments{/number}","issue_comment_url":"https://api.github.com/repos/willroyMyles/VR/issues/comments{/number}","contents_url":"https://api.github.com/repos/willroyMyles/VR/contents/{+path}","compare_url":"https://api.github.com/repos/willroyMyles/VR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/willroyMyles/VR/merges","archive_url":"https://api.github.com/repos/willroyMyles/VR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/willroyMyles/VR/downloads","issues_url":"https://api.github.com/repos/willroyMyles/VR/issues{/number}","pulls_url":"https://api.github.com/repos/willroyMyles/VR/pulls{/number}","milestones_url":"https://api.github.com/repos/willroyMyles/VR/milestones{/number}","notifications_url":"https://api.github.com/repos/willroyMyles/VR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/willroyMyles/VR/labels{/name}","releases_url":"https://api.github.com/repos/willroyMyles/VR/releases{/id}","deployments_url":"https://api.github.com/repos/willroyMyles/VR/deployments","created_at":"2018-04-21T22:55:27Z","updated_at":"2018-04-21T22:55:32Z","pushed_at":"2018-05-20T01:40:07Z","git_url":"git://github.com/willroyMyles/VR.git","ssh_url":"git@github.com:willroyMyles/VR.git","clone_url":"https://github.com/willroyMyles/VR.git","svn_url":"https://github.com/willroyMyles/VR","homepage":null,"size":420218,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jahshaka:dev","ref":"dev","sha":"45e41ef106020778a8ef415117dafa5a144c5b19","user":{"login":"jahshaka","id":6324793,"avatar_url":"https://avatars1.githubusercontent.com/u/6324793?v=4","gravatar_id":"","url":"https://api.github.com/users/jahshaka","html_url":"https://github.com/jahshaka","followers_url":"https://api.github.com/users/jahshaka/followers","following_url":"https://api.github.com/users/jahshaka/following{/other_user}","gists_url":"https://api.github.com/users/jahshaka/gists{/gist_id}","starred_url":"https://api.github.com/users/jahshaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahshaka/subscriptions","organizations_url":"https://api.github.com/users/jahshaka/orgs","repos_url":"https://api.github.com/users/jahshaka/repos","events_url":"https://api.github.com/users/jahshaka/events{/privacy}","received_events_url":"https://api.github.com/users/jahshaka/received_events","type":"User","site_admin":false},"repo":{"id":69066161,"name":"VR","full_name":"jahshaka/VR","owner":{"login":"jahshaka","id":6324793,"avatar_url":"https://avatars1.githubusercontent.com/u/6324793?v=4","gravatar_id":"","url":"https://api.github.com/users/jahshaka","html_url":"https://github.com/jahshaka","followers_url":"https://api.github.com/users/jahshaka/followers","following_url":"https://api.github.com/users/jahshaka/following{/other_user}","gists_url":"https://api.github.com/users/jahshaka/gists{/gist_id}","starred_url":"https://api.github.com/users/jahshaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jahshaka/subscriptions","organizations_url":"https://api.github.com/users/jahshaka/orgs","repos_url":"https://api.github.com/users/jahshaka/repos","events_url":"https://api.github.com/users/jahshaka/events{/privacy}","received_events_url":"https://api.github.com/users/jahshaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jahshaka/VR","description":"Jahshaka VR","fork":false,"url":"https://api.github.com/repos/jahshaka/VR","forks_url":"https://api.github.com/repos/jahshaka/VR/forks","keys_url":"https://api.github.com/repos/jahshaka/VR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jahshaka/VR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jahshaka/VR/teams","hooks_url":"https://api.github.com/repos/jahshaka/VR/hooks","issue_events_url":"https://api.github.com/repos/jahshaka/VR/issues/events{/number}","events_url":"https://api.github.com/repos/jahshaka/VR/events","assignees_url":"https://api.github.com/repos/jahshaka/VR/assignees{/user}","branches_url":"https://api.github.com/repos/jahshaka/VR/branches{/branch}","tags_url":"https://api.github.com/repos/jahshaka/VR/tags","blobs_url":"https://api.github.com/repos/jahshaka/VR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jahshaka/VR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jahshaka/VR/git/refs{/sha}","trees_url":"https://api.github.com/repos/jahshaka/VR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jahshaka/VR/statuses/{sha}","languages_url":"https://api.github.com/repos/jahshaka/VR/languages","stargazers_url":"https://api.github.com/repos/jahshaka/VR/stargazers","contributors_url":"https://api.github.com/repos/jahshaka/VR/contributors","subscribers_url":"https://api.github.com/repos/jahshaka/VR/subscribers","subscription_url":"https://api.github.com/repos/jahshaka/VR/subscription","commits_url":"https://api.github.com/repos/jahshaka/VR/commits{/sha}","git_commits_url":"https://api.github.com/repos/jahshaka/VR/git/commits{/sha}","comments_url":"https://api.github.com/repos/jahshaka/VR/comments{/number}","issue_comment_url":"https://api.github.com/repos/jahshaka/VR/issues/comments{/number}","contents_url":"https://api.github.com/repos/jahshaka/VR/contents/{+path}","compare_url":"https://api.github.com/repos/jahshaka/VR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jahshaka/VR/merges","archive_url":"https://api.github.com/repos/jahshaka/VR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jahshaka/VR/downloads","issues_url":"https://api.github.com/repos/jahshaka/VR/issues{/number}","pulls_url":"https://api.github.com/repos/jahshaka/VR/pulls{/number}","milestones_url":"https://api.github.com/repos/jahshaka/VR/milestones{/number}","notifications_url":"https://api.github.com/repos/jahshaka/VR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jahshaka/VR/labels{/name}","releases_url":"https://api.github.com/repos/jahshaka/VR/releases{/id}","deployments_url":"https://api.github.com/repos/jahshaka/VR/deployments","created_at":"2016-09-23T22:56:19Z","updated_at":"2018-05-16T13:11:33Z","pushed_at":"2018-05-20T06:02:53Z","git_url":"git://github.com/jahshaka/VR.git","ssh_url":"git@github.com:jahshaka/VR.git","clone_url":"https://github.com/jahshaka/VR.git","svn_url":"https://github.com/jahshaka/VR","homepage":null,"size":420142,"stargazers_count":51,"watchers_count":51,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":9,"open_issues":4,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/294"},"html":{"href":"https://github.com/jahshaka/VR/pull/294"},"issue":{"href":"https://api.github.com/repos/jahshaka/VR/issues/294"},"comments":{"href":"https://api.github.com/repos/jahshaka/VR/issues/294/comments"},"review_comments":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/294/comments"},"review_comment":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jahshaka/VR/pulls/294/commits"},"statuses":{"href":"https://api.github.com/repos/jahshaka/VR/statuses/d90ed142306c58e9163850919b64db252d965c0e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"iKlsR"}}