- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
import type { LineStyle } from '../styles/LineStyle';
import type { FillStyle } from '../styles/FillStyle';
/**
* A structure to hold interim batch objects for Graphics.
* @memberof PIXI.graphicsUtils
*/
export class BatchPart
{
public style: LineStyle | FillStyle;
public start: number;
public size: number;
public attribStart: number;
public attribSize: number;
constructor()
{
this.reset();
}
/**
* Begin batch part.
* @param style
* @param startIndex
* @param attribStart
*/
public begin(style: LineStyle | FillStyle, startIndex: number, attribStart: number): void
{
this.reset();
this.style = style;
this.start = startIndex;
this.attribStart = attribStart;
}
/**
* End batch part.
* @param endIndex
* @param endAttrib
*/
public end(endIndex: number, endAttrib: number): void
{
this.attribSize = endAttrib - this.attribStart;
this.size = endIndex - this.start;
}
public reset(): void
{
this.style = null;
this.size = 0;
this.start = 0;
this.attribStart = 0;
this.attribSize = 0;
}
}