Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
gwyneblaidd committed Feb 18, 2019
1 parent 36338ee commit d6758f1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/elements/element.rectangle.js
Expand Up @@ -123,13 +123,8 @@ module.exports = Element.extend({
// Find first (starting) corner with fallback to 'bottom'
var borders = ['bottom', 'left', 'top', 'right'];
var startCorner = borders.indexOf(borderSkipped, 0);
if (borderSkipped === null) {
if (borderSkipped === null || startCorner === -1) {
startCorner = 0;
} else {
startCorner = borders.indexOf(borderSkipped, 0);
if (startCorner === -1) {
startCorner = 0;
}
}

function cornerAt(index) {
Expand Down

0 comments on commit d6758f1

Please sign in to comment.