android.graphics.Path.getFillType()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中android.graphics.Path.getFillType()方法的一些代码示例,展示了Path.getFillType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.getFillType()方法的具体详情如下:
包路径:android.graphics.Path
类名称:Path
方法名:getFillType

Path.getFillType介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

public PathAssert hasFillType(Path.FillType type) {
 isNotNull();
 Path.FillType actualType = actual.getFillType();
 assertThat(actualType) //
   .overridingErrorMessage("Expected fill type <%s> but was <%s>.", type, actualType) //
   .isEqualTo(type);
 return this;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void getFillType() {
 Path path = new Path();
 path.setFillType(Path.FillType.EVEN_ODD);
 assertThat(path.getFillType()).isEqualTo(Path.FillType.EVEN_ODD);
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public PathWindingRule getWindingRule() {
  switch(this.path.getFillType()) {
  case EVEN_ODD:
  case INVERSE_EVEN_ODD:
    return PathWindingRule.EVEN_ODD;
  case WINDING:
  case INVERSE_WINDING:
  default:
    return PathWindingRule.NON_ZERO;
  }
}

代码示例来源:origin: AlexMofer/ProjectX

/**
 * Return the path's fill type. This defines how "inside" is
 * computed. The default value is WINDING.
 *
 * @return the path's fill type
 */
public Path.FillType getFillType() {
  return mPath.getFillType();
}

代码示例来源:origin: posm/OpenMapKitAndroid

@Override
public FillType getFillType() {
  return super.getFillType();
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public PathAssert hasFillType(Path.FillType type) {
 isNotNull();
 Path.FillType actualType = actual.getFillType();
 assertThat(actualType) //
   .overridingErrorMessage("Expected fill type <%s> but was <%s>.", type, actualType) //
   .isEqualTo(type);
 return this;
}

代码示例来源:origin: AlexMofer/ProjectX

private void updateDrawPath(Rect bounds) {
  mDrawPath.reset();
  mDrawPath.setFillType(mPath.getFillType());
  if (bounds == null || bounds.isEmpty() || mViewportWidth == 0 || mViewportHeight == 0)
    return;
  mMatrix.reset();
  mMatrix.postTranslate(bounds.left, bounds.top);
  mMatrix.postScale(bounds.width() / mViewportWidth,
      bounds.height() / mViewportHeight);
  if (mPath.isEmpty())
    return;
  mPath.transform(mMatrix, mDrawPath);
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public boolean intersects(PathIterator2f s) {
  FillType type = this.path.getFillType();
  int mask = (type == FillType.WINDING || type == FillType.INVERSE_WINDING ? -1 : 2);
  int crossings = Path2f.computeCrossingsFromPath(
      s,
      new PathShadow2f(this),
      false,
      true);
  return (crossings == MathConstants.SHAPE_INTERSECTS ||
      (crossings & mask) != 0);
}

代码示例来源:origin: AlexMofer/ProjectX

/**
 * Set the path's fill type. This defines how "inside" is computed.
 *
 * @param ft The new fill type for this path
 */
public void setFillType(Path.FillType ft) {
  if (mPath.getFillType() == ft)
    return;
  mPath.setFillType(ft);
  mDrawPath.setFillType(ft);
  invalidateSelf();
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public boolean intersects(Path2f s) {
  FillType type = this.path.getFillType();
  int mask = (type == FillType.WINDING || type == FillType.INVERSE_WINDING ? -1 : 2);
  int crossings = Path2f.computeCrossingsFromPath(
      s.getPathIterator((float)MathConstants.SPLINE_APPROXIMATION_RATIO),
      new PathShadow2f(this),
      false,
      true);
  return (crossings == MathConstants.SHAPE_INTERSECTS ||
      (crossings & mask) != 0);
}

代码示例来源:origin: AlexMofer/ProjectX

/**
 * Toggles the INVERSE state of the filltype
 */
public void toggleInverseFillType() {
  mPath.toggleInverseFillType();
  mDrawPath.setFillType(mPath.getFillType());
  invalidateSelf();
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public boolean intersects(Circle2f s) {
  FillType type = this.path.getFillType();
  int mask = (type == FillType.WINDING || type == FillType.INVERSE_WINDING ? -1 : 2);
  int crossings = Path2f.computeCrossingsFromCircle(
      0,
      getPathIterator((float)MathConstants.SPLINE_APPROXIMATION_RATIO),
      s.getX(), s.getY(), s.getRadius(),
      false,
      true);
  return (crossings == MathConstants.SHAPE_INTERSECTS ||
      (crossings & mask) != 0);
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public boolean intersects(Ellipse2f s) {
  FillType type = this.path.getFillType();
  int mask = (type == FillType.WINDING || type == FillType.INVERSE_WINDING ? -1 : 2);
  int crossings = Path2f.computeCrossingsFromEllipse(
      0,
      getPathIterator((float)MathConstants.SPLINE_APPROXIMATION_RATIO),
      s.getMinX(), s.getMinY(), s.getWidth(), s.getHeight(),
      false, true);
  return (crossings == MathConstants.SHAPE_INTERSECTS ||
      (crossings & mask) != 0);
}

代码示例来源:origin: org.arakhne.afc.ui/vector-android

@Override
public boolean intersects(Segment2f s) {
  FillType type = this.path.getFillType();
  int mask = (type == FillType.WINDING || type == FillType.INVERSE_WINDING ? -1 : 2);
  int crossings = Path2f.computeCrossingsFromSegment(
      0,
      getPathIterator((float)MathConstants.SPLINE_APPROXIMATION_RATIO),
      s.getX1(), s.getY1(), s.getX2(), s.getY2(),
      false);
  return (crossings == MathConstants.SHAPE_INTERSECTS ||
      (crossings & mask) != 0);
}

相关文章