Java 类com.facebook.csslayout.FloatUtil 实例源码

项目:ReactNativeSignatureExample    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius) {
  if (!FloatUtil.floatsEqual(mBorderRadius,radius)) {
    mBorderRadius = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:ReactNativeSignatureExample    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-ibeacon-android    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius) {
  if (!FloatUtil.floatsEqual(mBorderRadius,radius)) {
    mBorderRadius = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-ibeacon-android    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-box-loaders    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius) {
  if (!FloatUtil.floatsEqual(mBorderRadius,radius)) {
    mBorderRadius = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-box-loaders    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:react-native-box-loaders    文件:ReactImageView.java   
@Override
public void process(Bitmap output, Bitmap source) {
  cornerRadii(sComputedCornerRadii);

  output.setHasAlpha(true);
  if (FloatUtil.floatsEqual(sComputedCornerRadii[0], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[1], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[2], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[3], 0f)) {
    super.process(output, source);
    return;
  }
  Paint paint = new Paint();
  paint.setAntiAlias(true);
  paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
  Canvas canvas = new Canvas(output);

  float[] radii = new float[8];

  getRadii(source, sComputedCornerRadii, radii);

  Path pathForBorderRadius = new Path();

  pathForBorderRadius.addRoundRect(
      new RectF(0, 0, source.getWidth(), source.getHeight()),
      radii,
      Path.Direction.CW);

  canvas.drawPath(pathForBorderRadius, paint);
}
项目:react-native-box-loaders    文件:ReactImageView.java   
public void setBorderRadius(float borderRadius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], borderRadius)) {
    mBorderCornerRadii[position] = borderRadius;
    mIsDirty = true;
  }
}
项目:Ironman    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius) {
  if (!FloatUtil.floatsEqual(mBorderRadius,radius)) {
    mBorderRadius = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:Ironman    文件:ReactViewBackgroundDrawable.java   
public void setRadius(float radius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], radius)) {
    mBorderCornerRadii[position] = radius;
    mNeedUpdatePathForBorderRadius = true;
    invalidateSelf();
  }
}
项目:Ironman    文件:ReactImageView.java   
@Override
public void process(Bitmap output, Bitmap source) {
  cornerRadii(sComputedCornerRadii);

  output.setHasAlpha(true);
  if (FloatUtil.floatsEqual(sComputedCornerRadii[0], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[1], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[2], 0f) &&
      FloatUtil.floatsEqual(sComputedCornerRadii[3], 0f)) {
    super.process(output, source);
    return;
  }
  Paint paint = new Paint();
  paint.setAntiAlias(true);
  paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
  Canvas canvas = new Canvas(output);

  float[] radii = new float[8];

  getRadii(source, sComputedCornerRadii, radii);

  Path pathForBorderRadius = new Path();

  pathForBorderRadius.addRoundRect(
      new RectF(0, 0, source.getWidth(), source.getHeight()),
      radii,
      Path.Direction.CW);

  canvas.drawPath(pathForBorderRadius, paint);
}
项目:Ironman    文件:ReactImageView.java   
public void setBorderRadius(float borderRadius, int position) {
  if (mBorderCornerRadii == null) {
    mBorderCornerRadii = new float[4];
    Arrays.fill(mBorderCornerRadii, CSSConstants.UNDEFINED);
  }

  if (!FloatUtil.floatsEqual(mBorderCornerRadii[position], borderRadius)) {
    mBorderCornerRadii[position] = borderRadius;
    mIsDirty = true;
  }
}
项目:react-native-box-loaders    文件:ReactImageView.java   
public void setBorderRadius(float borderRadius) {
  if (!FloatUtil.floatsEqual(mBorderRadius, borderRadius)) {
    mBorderRadius = borderRadius;
    mIsDirty = true;
  }
}
项目:Ironman    文件:ReactImageView.java   
public void setBorderRadius(float borderRadius) {
  if (!FloatUtil.floatsEqual(mBorderRadius, borderRadius)) {
    mBorderRadius = borderRadius;
    mIsDirty = true;
  }
}