@@ -241,9 +241,9 @@ public static Drawable compositeTwoLayeredDrawable(
241241 * @param bottomLayerDrawable the drawable to be on the bottom layer
242242 * @param topLayerDrawable the drawable to be on the top layer
243243 * @param topLayerDesiredWidth top layer desired width in pixels, or {@link #INTRINSIC_SIZE} to
244- * use the intrinsic width.
244+ * use the intrinsic width as the desired one .
245245 * @param topLayerDesiredHeight top layer desired height in pixels, or {@link #INTRINSIC_SIZE} to
246- * use the intrinsic height.
246+ * use the intrinsic height as the desired one .
247247 */
248248 @ Nullable
249249 public static Drawable compositeTwoLayeredDrawable (
@@ -258,8 +258,6 @@ public static Drawable compositeTwoLayeredDrawable(
258258 return bottomLayerDrawable ;
259259 }
260260
261- boolean shouldScaleTopLayer =
262- topLayerDesiredWidth != INTRINSIC_SIZE && topLayerDesiredHeight != INTRINSIC_SIZE ;
263261 if (topLayerDesiredWidth == INTRINSIC_SIZE ) {
264262 topLayerDesiredWidth = getTopLayerIntrinsicWidth (bottomLayerDrawable , topLayerDrawable );
265263 }
@@ -300,10 +298,9 @@ public static Drawable compositeTwoLayeredDrawable(
300298 drawable .setLayerSize (1 , topLayerNewWidth , topLayerNewHeight );
301299 drawable .setLayerGravity (1 , Gravity .CENTER );
302300 } else {
303- if (shouldScaleTopLayer ) {
304- topLayerDrawable =
305- new ScaledDrawableWrapper (topLayerDrawable , topLayerNewWidth , topLayerNewHeight );
306- }
301+ topLayerDrawable =
302+ new ScaledDrawableWrapper (topLayerDrawable , topLayerNewWidth , topLayerNewHeight );
303+
307304 drawable = new LayerDrawable (new Drawable [] {bottomLayerDrawable , topLayerDrawable });
308305
309306 final int horizontalInset =
0 commit comments