|
|
|
@ -35,6 +35,8 @@ namespace TheGameExtreme.view
|
|
|
|
|
this.width = width;
|
|
|
|
|
height = (0.2f * (float)DeviceDisplay.MainDisplayInfo.Height - textPaint.TextSize) * 0.5f;
|
|
|
|
|
|
|
|
|
|
display = Value.ToString();
|
|
|
|
|
|
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
|
{
|
|
|
|
|
textPaint1 = new SKPaint();
|
|
|
|
@ -42,21 +44,20 @@ namespace TheGameExtreme.view
|
|
|
|
|
textPaint1.TextSize = textPaint.TextSize;
|
|
|
|
|
textPaint2.TextSize = textPaint.TextSize;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
display = Value.ToString();
|
|
|
|
|
|
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
|
{
|
|
|
|
|
if (Value.Value.CompareTo(-10m) <= 0)
|
|
|
|
|
{
|
|
|
|
|
this.width -= textPaint.MeasureText("0") * 0.25f;
|
|
|
|
|
}
|
|
|
|
|
if (Value.Value.CompareTo(0m) >= 0 && Value.Value.CompareTo(10) < 0)
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
|
{
|
|
|
|
|
this.width += textPaint.MeasureText("0") * 0.5f;
|
|
|
|
|
if (Value.Value.CompareTo(-10m) <= 0)
|
|
|
|
|
{
|
|
|
|
|
this.width -= textPaint.MeasureText("0") * 0.25f;
|
|
|
|
|
}
|
|
|
|
|
if (Value.Value.CompareTo(0m) >= 0 && Value.Value.CompareTo(10) < 0)
|
|
|
|
|
{
|
|
|
|
|
this.width += textPaint.MeasureText("0") * 0.5f;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
Matrix = SKMatrix.MakeIdentity();
|
|
|
|
|
|
|
|
|
@ -107,23 +108,9 @@ namespace TheGameExtreme.view
|
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
|
{
|
|
|
|
|
canvas.DrawRect(card, textPaint1);
|
|
|
|
|
if (((FractionCard)Value.View).Fraction.Numerateur < 10 && ((FractionCard)Value.View).Fraction.Numerateur > 0)
|
|
|
|
|
{
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, - textPaint.TextSize * 0.5f - height * 0.5f, textPaint);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, - textPaint.TextSize * 0.5f - height * 0.5f, textPaint);
|
|
|
|
|
}
|
|
|
|
|
canvas.DrawText("__", textPaint.MeasureText("__") * 0.1f, -textPaint.TextSize * 0.6f, textPaint1);
|
|
|
|
|
if (((FractionCard)Value.View).Fraction.Denominateur < 10 && ((FractionCard)Value.View).Fraction.Denominateur > 0)
|
|
|
|
|
{
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, height * 0.5f, textPaint2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, 50, textPaint2);
|
|
|
|
|
}
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, - textPaint.TextSize * 0.5f - height * 0.5f, textPaint);
|
|
|
|
|
canvas.DrawText("___", width * 0.5f - textPaint1.MeasureText("___") * 0.5f, -textPaint1.TextSize * 0.6f, textPaint1);
|
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), width * 0.5f - textPaint2.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, height * 0.5f, textPaint2);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|