|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public CanvasImpl() { |
|
|
|
this._transform = Matrix4x4.Scale(new Vector3( |
|
|
|
1.0f / EditorGUIUtility.pixelsPerPoint, |
|
|
|
1.0f / EditorGUIUtility.pixelsPerPoint, |
|
|
|
1.0f)); |
|
|
|
|
|
|
|
this._transform = Matrix4x4.identity; |
|
|
|
this._defaultTexture = RenderTexture.active; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
var drawPicture = (DrawPicture) drawCmd; |
|
|
|
this.drawPicture(drawPicture.picture); |
|
|
|
} else if (drawCmd is DrawConcat) { |
|
|
|
var drawConcat = (DrawConcat) drawCmd; |
|
|
|
var drawConcat = (DrawConcat) drawCmd; |
|
|
|
this.concat(drawConcat.transform); |
|
|
|
} else if (drawCmd is DrawSetMatrix) { |
|
|
|
var drawSetMatrix = (DrawSetMatrix) drawCmd; |
|
|
|
|
|
|
this.pushClipRRect(rect, this._transform); |
|
|
|
} |
|
|
|
|
|
|
|
public void drawTextBlob(TextBlob textBlob, Offset offset) |
|
|
|
{ |
|
|
|
public void drawTextBlob(TextBlob textBlob, Offset offset) { |
|
|
|
var mesh = MeshGenrator.generateMesh(textBlob); |
|
|
|
var font = FontManager.instance.getOrCreate(textBlob.style.fontFamily).font; |
|
|
|
prepareGL(font.material); |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var textBlobOffset = textBlob.positions[textBlob.start]; |
|
|
|
|
|
|
|
|
|
|
|
Graphics.DrawMeshNow(mesh, this._transform * Matrix4x4.Translate( |
|
|
|
new Vector3((float) Utils.PixelCorrectRound(offset.dx + textBlobOffset.x), |
|
|
|
(float) Utils.PixelCorrectRound(offset.dy + textBlobOffset.y), 0))); |
|
|
|