diff --git a/library/src/main/java/com/noober/background/BackgroundFactory.java b/library/src/main/java/com/noober/background/BackgroundFactory.java index 9d34e00..bd48b41 100644 --- a/library/src/main/java/com/noober/background/BackgroundFactory.java +++ b/library/src/main/java/com/noober/background/BackgroundFactory.java @@ -293,10 +293,10 @@ private static void setBackground(Drawable drawable, View view, TypedArray typed int bottom = 1 << 4; float width = typedArray.getDimension(R.styleable.background_bl_stroke_width, 0f); int position = typedArray.getInt(R.styleable.background_bl_stroke_position, 0); - float leftValue = hasStatus(position, left) ? width : -width; - float topValue = hasStatus(position, top) ? width : -width; - float rightValue = hasStatus(position, right) ? width : -width; - float bottomValue = hasStatus(position, bottom) ? width : -width; + float leftValue = hasStatus(position, left) ? 0 : -width; + float topValue = hasStatus(position, top) ? 0 : -width; + float rightValue = hasStatus(position, right) ? 0 : -width; + float bottomValue = hasStatus(position, bottom) ? 0 : -width; drawable = new LayerDrawable(new Drawable[]{drawable}); ((LayerDrawable) drawable).setLayerInset(0, (int) leftValue, (int) topValue, (int) rightValue, (int) bottomValue); } diff --git a/libraryx/src/main/java/com/noober/background/BackgroundFactory.java b/libraryx/src/main/java/com/noober/background/BackgroundFactory.java index 36dc453..6dea782 100644 --- a/libraryx/src/main/java/com/noober/background/BackgroundFactory.java +++ b/libraryx/src/main/java/com/noober/background/BackgroundFactory.java @@ -296,10 +296,10 @@ private static void setBackground(Drawable drawable, View view, TypedArray typed int bottom = 1 << 4; float width = typedArray.getDimension(R.styleable.background_bl_stroke_width, 0f); int position = typedArray.getInt(R.styleable.background_bl_stroke_position, 0); - float leftValue = hasStatus(position, left) ? width : -width; - float topValue = hasStatus(position, top) ? width : -width; - float rightValue = hasStatus(position, right) ? width : -width; - float bottomValue = hasStatus(position, bottom) ? width : -width; + float leftValue = hasStatus(position, left) ? 0 : -width; + float topValue = hasStatus(position, top) ? 0 : -width; + float rightValue = hasStatus(position, right) ? 0 : -width; + float bottomValue = hasStatus(position, bottom) ? 0 : -width; drawable = new LayerDrawable(new Drawable[]{drawable}); ((LayerDrawable) drawable).setLayerInset(0, (int) leftValue, (int) topValue, (int) rightValue, (int) bottomValue); }