|
|
|
|
|
|
namespace Unity.UIWidgets.ui { |
|
|
|
public abstract class uiDrawCmd : PoolObject { |
|
|
|
public abstract void release(); |
|
|
|
public abstract uiRect bounds(float margin); |
|
|
|
public abstract class uiStateUpdateDrawCmd : uiDrawCmd { |
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.zero; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawSave : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawSave : uiDrawCmd { |
|
|
|
public uiDrawSave() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawSaveLayer : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawSaveLayer : uiDrawCmd { |
|
|
|
public uiDrawSaveLayer() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public uiPaint paint; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawRestore : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawRestore : uiDrawCmd { |
|
|
|
public uiDrawRestore() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawTranslate : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawTranslate : uiDrawCmd { |
|
|
|
public uiDrawTranslate() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public float dy; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawScale : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawScale : uiDrawCmd { |
|
|
|
public uiDrawScale() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public float? sy; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawRotate : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawRotate : uiDrawCmd { |
|
|
|
public uiDrawRotate() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public uiOffset? offset; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawSkew : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawSkew : uiDrawCmd { |
|
|
|
public uiDrawSkew() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public float sy; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawConcat : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawConcat : uiDrawCmd { |
|
|
|
public uiDrawConcat() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public uiMatrix3? matrix; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawResetMatrix : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawResetMatrix : uiDrawCmd { |
|
|
|
public uiDrawResetMatrix() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawSetMatrix : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawSetMatrix : uiDrawCmd { |
|
|
|
public uiDrawSetMatrix() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public uiMatrix3? matrix; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawClipRect : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawClipRect : uiDrawCmd { |
|
|
|
public uiDrawClipRect() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public uiRect? rect; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawClipRRect : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawClipRRect : uiDrawCmd { |
|
|
|
public uiDrawClipRRect() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
public RRect rrect; |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawClipPath : uiStateUpdateDrawCmd { |
|
|
|
public class uiDrawClipPath : uiDrawCmd { |
|
|
|
public uiDrawClipPath() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public uiPath path; |
|
|
|
public uiPaint paint; |
|
|
|
|
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return this.path.getBoundsWithMargin(margin); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawImage : uiDrawCmd { |
|
|
|
|
|
|
public Image image; |
|
|
|
public uiOffset? offset; |
|
|
|
public uiPaint paint; |
|
|
|
|
|
|
|
|
|
|
|
// TODO: Should divide by device pixel ratio here, which is not available as
|
|
|
|
// this DrawCmd is created. This bounds should only used as an upper bound,
|
|
|
|
// assuming that device pixel ratio is always >= 1
|
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.fromLTWH( |
|
|
|
this.offset.Value.dx - margin, this.offset.Value.dy - margin, |
|
|
|
this.image.width + 2 * margin, |
|
|
|
this.image.height + 2 * margin); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawImageRect : uiDrawCmd { |
|
|
|
|
|
|
public uiRect? src; |
|
|
|
public uiRect? dst; |
|
|
|
public uiPaint paint; |
|
|
|
|
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.inflate(this.dst.Value, margin); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawImageNine : uiDrawCmd { |
|
|
|
|
|
|
public uiRect? center; |
|
|
|
public uiRect? dst; |
|
|
|
public uiPaint paint; |
|
|
|
|
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.fromLTRB( |
|
|
|
this.dst.Value.left + ((this.center.Value.left - this.src.Value.left) * this.src.Value.width) - margin, |
|
|
|
this.dst.Value.top + ((this.center.Value.top - this.src.Value.top) * this.src.Value.height) - margin, |
|
|
|
this.dst.Value.right - ((this.src.Value.right - this.center.Value.right) * this.src.Value.width) + margin, |
|
|
|
this.dst.Value.bottom - ((this.src.Value.bottom - this.center.Value.bottom) * this.src.Value.height) + margin |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawPicture : uiDrawCmd { |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public Picture picture; |
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.fromRect(this.picture.paintBounds.inflate(margin)).Value; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class uiDrawTextBlob : uiDrawCmd { |
|
|
|
|
|
|
public TextBlob? textBlob; |
|
|
|
public uiOffset? offset; |
|
|
|
public uiPaint paint; |
|
|
|
|
|
|
|
public override uiRect bounds(float margin) { |
|
|
|
return uiRectHelper.fromRect(this.textBlob.Value.boundsInText.translate( |
|
|
|
this.offset.Value.dx, this.offset.Value.dy).inflate(margin)).Value; |
|
|
|
} |
|
|
|
} |
|
|
|
} |