boxpointer: Add condition checks for -arrow-rise:0px
This is done for properly drawing popup menu when arrow rise is 0 (in case of background menu). Normally, the menu with arrow rise set to 0 is drawn properly having all four corners rounded. But when the source(click/arrowOrigin) is near screen's edges, one of the corners (depending on source's position and arrow alignment) is drawn right angled. This happens because the rounded corners are skipped and right angled arrow is drawn when arrow origin is close to the edges.(That's why when arrow-rise is 0, it forms right angled corner). So, a few condition checks are made to ensure that right angled corner is not drawn. https://bugzilla.gnome.org/show_bug.cgi?id=699608
This commit is contained in:
parent
297877fbe2
commit
cbceac4c8a
@ -287,38 +287,40 @@ const BoxPointer = new Lang.Class({
|
|||||||
let skipBottomLeft = false;
|
let skipBottomLeft = false;
|
||||||
let skipBottomRight = false;
|
let skipBottomRight = false;
|
||||||
|
|
||||||
switch (this._arrowSide) {
|
if (rise) {
|
||||||
case St.Side.TOP:
|
switch (this._arrowSide) {
|
||||||
if (this._arrowOrigin == x1)
|
case St.Side.TOP:
|
||||||
skipTopLeft = true;
|
if (this._arrowOrigin == x1)
|
||||||
else if (this._arrowOrigin == x2)
|
skipTopLeft = true;
|
||||||
skipTopRight = true;
|
else if (this._arrowOrigin == x2)
|
||||||
break;
|
skipTopRight = true;
|
||||||
|
break;
|
||||||
|
|
||||||
case St.Side.RIGHT:
|
case St.Side.RIGHT:
|
||||||
if (this._arrowOrigin == y1)
|
if (this._arrowOrigin == y1)
|
||||||
skipTopRight = true;
|
skipTopRight = true;
|
||||||
else if (this._arrowOrigin == y2)
|
else if (this._arrowOrigin == y2)
|
||||||
skipBottomRight = true;
|
skipBottomRight = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case St.Side.BOTTOM:
|
case St.Side.BOTTOM:
|
||||||
if (this._arrowOrigin == x1)
|
if (this._arrowOrigin == x1)
|
||||||
skipBottomLeft = true;
|
skipBottomLeft = true;
|
||||||
else if (this._arrowOrigin == x2)
|
else if (this._arrowOrigin == x2)
|
||||||
skipBottomRight = true;
|
skipBottomRight = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case St.Side.LEFT:
|
case St.Side.LEFT:
|
||||||
if (this._arrowOrigin == y1)
|
if (this._arrowOrigin == y1)
|
||||||
skipTopLeft = true;
|
skipTopLeft = true;
|
||||||
else if (this._arrowOrigin == y2)
|
else if (this._arrowOrigin == y2)
|
||||||
skipBottomLeft = true;
|
skipBottomLeft = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cr.moveTo(x1 + borderRadius, y1);
|
cr.moveTo(x1 + borderRadius, y1);
|
||||||
if (this._arrowSide == St.Side.TOP) {
|
if (this._arrowSide == St.Side.TOP && rise) {
|
||||||
if (skipTopLeft) {
|
if (skipTopLeft) {
|
||||||
cr.moveTo(x1, y2 - borderRadius);
|
cr.moveTo(x1, y2 - borderRadius);
|
||||||
cr.lineTo(x1, y1 - rise);
|
cr.lineTo(x1, y1 - rise);
|
||||||
@ -340,7 +342,7 @@ const BoxPointer = new Lang.Class({
|
|||||||
3*Math.PI/2, Math.PI*2);
|
3*Math.PI/2, Math.PI*2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.RIGHT) {
|
if (this._arrowSide == St.Side.RIGHT && rise) {
|
||||||
if (skipTopRight) {
|
if (skipTopRight) {
|
||||||
cr.lineTo(x2 + rise, y1);
|
cr.lineTo(x2 + rise, y1);
|
||||||
cr.lineTo(x2 + rise, y1 + halfBase);
|
cr.lineTo(x2 + rise, y1 + halfBase);
|
||||||
@ -361,7 +363,7 @@ const BoxPointer = new Lang.Class({
|
|||||||
0, Math.PI/2);
|
0, Math.PI/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.BOTTOM) {
|
if (this._arrowSide == St.Side.BOTTOM && rise) {
|
||||||
if (skipBottomLeft) {
|
if (skipBottomLeft) {
|
||||||
cr.lineTo(x1 + halfBase, y2);
|
cr.lineTo(x1 + halfBase, y2);
|
||||||
cr.lineTo(x1, y2 + rise);
|
cr.lineTo(x1, y2 + rise);
|
||||||
@ -382,7 +384,7 @@ const BoxPointer = new Lang.Class({
|
|||||||
Math.PI/2, Math.PI);
|
Math.PI/2, Math.PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._arrowSide == St.Side.LEFT) {
|
if (this._arrowSide == St.Side.LEFT && rise) {
|
||||||
if (skipTopLeft) {
|
if (skipTopLeft) {
|
||||||
cr.lineTo(x1, y1 + halfBase);
|
cr.lineTo(x1, y1 + halfBase);
|
||||||
cr.lineTo(x1 - rise, y1);
|
cr.lineTo(x1 - rise, y1);
|
||||||
|
Loading…
Reference in New Issue
Block a user