{"action":"opened","issue":{"url":"https://api.github.com/repos/qmlweb/qmlweb/issues/317","repository_url":"https://api.github.com/repos/qmlweb/qmlweb","labels_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/317/labels{/name}","comments_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/317/comments","events_url":"https://api.github.com/repos/qmlweb/qmlweb/issues/317/events","html_url":"https://github.com/qmlweb/qmlweb/issues/317","id":168486701,"number":317,"title":"Rectangle border width calculation is broken","user":{"login":"ChALkeR","id":291301,"avatar_url":"https://avatars.githubusercontent.com/u/291301?v=3","gravatar_id":"","url":"https://api.github.com/users/ChALkeR","html_url":"https://github.com/ChALkeR","followers_url":"https://api.github.com/users/ChALkeR/followers","following_url":"https://api.github.com/users/ChALkeR/following{/other_user}","gists_url":"https://api.github.com/users/ChALkeR/gists{/gist_id}","starred_url":"https://api.github.com/users/ChALkeR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChALkeR/subscriptions","organizations_url":"https://api.github.com/users/ChALkeR/orgs","repos_url":"https://api.github.com/users/ChALkeR/repos","events_url":"https://api.github.com/users/ChALkeR/events{/privacy}","received_events_url":"https://api.github.com/users/ChALkeR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-30T21:00:09Z","updated_at":"2016-07-30T21:00:09Z","closed_at":null,"body":"https://github.com/qmlweb/qmlweb/blob/master/src/modules/QtQuick/Rectangle.js#L83-L103\r\nThat was introduced in https://github.com/qmlweb/qmlweb/pull/114.\r\n\r\nFirst of all,\r\n````js\r\nif ( this.height - 2 * this.border.width < this.border.width)\r\n```\r\nis equivalent to\r\n```js\r\nif ( this.height < 3 * this.border.width)\r\n```. What is that supposed to do?\r\n\r\nSecondly,\r\n```js\r\nbg.style.height = (this.height%2 ? -1 : -2 + this.height + (this.height - (2*this.border.width))) + 'px';\r\n```\r\nis equivalent to:\r\n```js\r\nif (this.height % 2) {\r\n  bg.style.height = \"-1px\";\r\n} else {\r\n  bg.style.height = `{-2 + 2 * this.height - 2 * this.border.width}px`;\r\n}\r\n```\r\n\r\nAlso,\r\n```js\r\n// ignore negative and 0px border width\r\nif (newBorderWidth == \"0px\" || newBorderWidth < 0) {\r\n    return;\r\n}\r\n```\r\nis equivalent to\r\n```\r\n// ignore negative and 0px border width\r\nif (newBorderWidth < 0) {\r\n    return;\r\n}\r\n```\r\nbecause `newBorderWidth` is always a number there.\r\n\r\nI'm pretty sure this doesn't work as it's supposed to.\r\n\r\n/cc @igosoft "}}
{"actor":{"display_login":"ChALkeR"}}