Detailed Description

Represents the a rounded corner of a border. This works by creating two sections - the "inverse" border and the border itself. The inverse border is essentially a series of transparent whose purpose is just to affect the depth buffer.

Public Member Functions

 RoundCorner (RoundedCorners roundCorners, RoundCornerPosition position)
 Creates a new rounded corner in the given position. More...
 
void RenderInverse (LayoutBox box, Renderman renderer, float cornerX, float cornerY)
 Renders the inverse of this corner for the border. More...
 
void Render (LayoutBox box, Renderman renderer, float cornerX, float cornerY)
 

Public Attributes

int ToIndex
 The edge index that this corner goes to. More...
 
int FromIndex
 The edge index that this corner goes from. More...
 
Color Colour
 The colour of this corner. More...
 
float CornerRadius
 The radius of this corner. More...
 
BorderProperty Border
 The border this corner belongs to. More...
 
int InverseBlocksRequired
 The number of inverse blocks required. More...
 
RoundedCorners RoundCorners
 The parent round corners set. More...
 
RoundCornerPosition Position
 The position of this corner (e.g. top left). More...
 
RoundBorderInverseProperty InverseBorder
 The inverse property which inverse fragments are rendered to. More...
 

Static Public Attributes

static int Resolution =4
 The amount of pixels per section of the corner. The lower this is, the smoother the corner (but the lower the performance). Below this, micro resolution is used instead. More...
 
static int MicroResolution =1
 The corner resolution if a corner radius is equal to resolution or lower. More...
 

Package Attributes

Vector2[] InnerArc
 How far the inner arc is from the corner of the original box at each block. More...
 

Properties

float Radius [get, set]
 The radius of this corner. More...
 

Private Member Functions

void RecomputeArcs (BoxStyle widths)
 Recomputes both arcs simultaneously. More...
 
void RecomputeInnerArc (BoxStyle widths)
 Recomputes the inner arc. The inner arc is special because it depends on border width. The two borders that this corner connects may be different widths, so it may have to transition from one thickness to another. More...
 

Private Attributes

Vector2[] OuterArc
 How far the outer arc is from the corner of the original box at each block. Note that this is always round; One axis is CornerRadius-theOtherAxis. More...
 
int BlocksRequired
 The number of blocks (fragments of the curve; translate directly to MeshBlocks) that this corner is constructed of. More...
 

Constructor & Destructor Documentation

Css.RoundCorner.RoundCorner ( RoundedCorners  roundCorners,
RoundCornerPosition  position 
)
inline

Creates a new rounded corner in the given position.

Member Function Documentation

void Css.RoundCorner.RecomputeArcs ( BoxStyle  widths)
inlineprivate

Recomputes both arcs simultaneously.

void Css.RoundCorner.RecomputeInnerArc ( BoxStyle  widths)
inlineprivate

Recomputes the inner arc. The inner arc is special because it depends on border width. The two borders that this corner connects may be different widths, so it may have to transition from one thickness to another.

void Css.RoundCorner.Render ( LayoutBox  box,
Renderman  renderer,
float  cornerX,
float  cornerY 
)
inline
void Css.RoundCorner.RenderInverse ( LayoutBox  box,
Renderman  renderer,
float  cornerX,
float  cornerY 
)
inline

Renders the inverse of this corner for the border.

Member Data Documentation

int Css.RoundCorner.BlocksRequired
private

The number of blocks (fragments of the curve; translate directly to MeshBlocks) that this corner is constructed of.

BorderProperty Css.RoundCorner.Border

The border this corner belongs to.

Color Css.RoundCorner.Colour

The colour of this corner.

float Css.RoundCorner.CornerRadius

The radius of this corner.

int Css.RoundCorner.FromIndex

The edge index that this corner goes from.

Vector2 [] Css.RoundCorner.InnerArc
package

How far the inner arc is from the corner of the original box at each block.

int Css.RoundCorner.InverseBlocksRequired

The number of inverse blocks required.

RoundBorderInverseProperty Css.RoundCorner.InverseBorder

The inverse property which inverse fragments are rendered to.

int Css.RoundCorner.MicroResolution =1
static

The corner resolution if a corner radius is equal to resolution or lower.

Vector2 [] Css.RoundCorner.OuterArc
private

How far the outer arc is from the corner of the original box at each block. Note that this is always round; One axis is CornerRadius-theOtherAxis.

RoundCornerPosition Css.RoundCorner.Position

The position of this corner (e.g. top left).

int Css.RoundCorner.Resolution =4
static

The amount of pixels per section of the corner. The lower this is, the smoother the corner (but the lower the performance). Below this, micro resolution is used instead.

RoundedCorners Css.RoundCorner.RoundCorners

The parent round corners set.

int Css.RoundCorner.ToIndex

The edge index that this corner goes to.

Property Documentation

float Css.RoundCorner.Radius
getset

The radius of this corner.