Package 

Class CorneredShape

  • All Implemented Interfaces:
    com.patrykandpatrick.vico.core.component.shape.Shape

    
    public class CorneredShape
     implements Shape
                        

    A Shape implementation with customizable corners.

    • Constructor Detail

      • CorneredShape

        CorneredShape(Corner topLeft, Corner topRight, Corner bottomRight, Corner bottomLeft)
        Parameters:
        topLeft - specifies a Corner for the top left of the Shape.
        topRight - specifies a Corner for the top right of the Shape.
        bottomRight - specifies a Corner for the bottom right of the Shape.
        bottomLeft - specifies a Corner for the bottom left of the Shape.
    • Method Detail

      • getCornerScale

         final Float getCornerScale(Float width, Float height, Float density)

        Returns a scale factor for the corner size, which will prevent graphical glitches in case the size of the corners is larger than the shape’s dimensions.

        Parameters:
        width - the width of the Shape.
        height - the height of the Shape.
        density - the pixel density of the screen (used in pixel size calculation).
      • drawShape

         Unit drawShape(DrawContext context, Paint paint, Path path, Float left, Float top, Float right, Float bottom)

        Draws the Shape on the canvas.

        Parameters:
        context - holds environment data.
        paint - the Paint used to draw the shape.
        path - the Path defining the shape.
        left - the x coordinate of the left edge of the bounds in which the shape should be drawn.
        top - the y coordinate of the top edge of the bounds in which the shape should be drawn.
        right - the x coordinate of the right edge of the bounds in which the shape should be drawn.
        bottom - the y coordinate of the bottom edge of the bounds in which the shape should be drawn.