fix: handling of rounded rect

fixes #1112
This commit is contained in:
Mikael Sand
2019-09-28 01:36:05 +03:00
parent 70c54e61a4
commit c12d66e779
3 changed files with 20 additions and 12 deletions
@@ -76,14 +76,19 @@ class RectView extends RenderableView {
double y = relativeOnHeight(mY);
double w = relativeOnWidth(mW);
double h = relativeOnHeight(mH);
double rx = relativeOnWidth(mRx);
double ry = relativeOnHeight(mRy);
if (rx != 0 || ry != 0) {
if (rx == 0) {
if (mRx != null || mRy != null) {
double rx = 0d;
double ry = 0d;
if (mRx == null) {
ry = relativeOnHeight(mRy);
rx = ry;
} else if (ry == 0) {
} else if (mRy == null) {
rx = relativeOnWidth(mRx);
ry = rx;
} else {
rx = relativeOnWidth(mRx);
ry = relativeOnHeight(mRy);
}
if (rx > w / 2) {
+10 -5
View File
@@ -72,14 +72,19 @@
CGFloat y = [self relativeOnHeight:self.y];
CGFloat width = [self relativeOnWidth:self.rectwidth];
CGFloat height = [self relativeOnHeight:self.rectheight];
CGFloat rx = [self relativeOnWidth:self.rx];
CGFloat ry = [self relativeOnHeight:self.ry];
if (rx != 0 || ry != 0) {
if (rx == 0) {
if (self.rx != nil || self.ry != nil) {
CGFloat rx = 0;
CGFloat ry = 0;
if (self.rx == nil) {
ry = [self relativeOnHeight:self.ry];
rx = ry;
} else if (ry == 0) {
} else if (self.ry == nil) {
rx = [self relativeOnWidth:self.rx];
ry = rx;
} else {
rx = [self relativeOnWidth:self.rx];
ry = [self relativeOnHeight:self.ry];
}
if (rx > width / 2) {
-2
View File
@@ -19,8 +19,6 @@ export default class Rect extends Shape<{
y: 0,
width: 0,
height: 0,
rx: 0,
ry: 0,
};
render() {