|
|
@ -32,6 +32,8 @@ namespace TheGameExtreme.view
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.textPaint = textPaint;
|
|
|
|
this.textPaint = textPaint;
|
|
|
|
Value = value;
|
|
|
|
Value = value;
|
|
|
|
|
|
|
|
this.width = width;
|
|
|
|
|
|
|
|
height = 2f * this.width;
|
|
|
|
|
|
|
|
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -43,9 +45,6 @@ namespace TheGameExtreme.view
|
|
|
|
|
|
|
|
|
|
|
|
display = Value.ToString();
|
|
|
|
display = Value.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
this.width = width;
|
|
|
|
|
|
|
|
height = 2f * width;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
if (!display.Contains(",") && !display.Contains(".") && !display.Contains("/"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Value.Value.CompareTo(-10m) <= 0)
|
|
|
|
if (Value.Value.CompareTo(-10m) <= 0)
|
|
|
@ -58,6 +57,7 @@ namespace TheGameExtreme.view
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Matrix = SKMatrix.MakeIdentity();
|
|
|
|
Matrix = SKMatrix.MakeIdentity();
|
|
|
|
|
|
|
|
|
|
|
|
Mode = TouchManipulationMode.PanOnly;
|
|
|
|
Mode = TouchManipulationMode.PanOnly;
|
|
|
@ -106,7 +106,7 @@ namespace TheGameExtreme.view
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
if (Value.View.GetType() == typeof(FractionCard))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
canvas.DrawRect(card, textPaint1);
|
|
|
|
canvas.DrawRect(card, textPaint1);
|
|
|
|
if (((FractionCard)Value.View).Fraction.Numerateur < 10 && ((FractionCard)Value.View).Fraction.Numerateur > 0) // Gros prob
|
|
|
|
if (((FractionCard)Value.View).Fraction.Numerateur < 10 && ((FractionCard)Value.View).Fraction.Numerateur > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, -50, textPaint);
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, -50, textPaint);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -114,7 +114,7 @@ namespace TheGameExtreme.view
|
|
|
|
{
|
|
|
|
{
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), 0, -50, textPaint);
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Numerateur.ToString(), 0, -50, textPaint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
canvas.DrawText("__", 0, -textPaint.TextSize * 0.5f, textPaint1);
|
|
|
|
canvas.DrawText("__", 0, -textPaint.TextSize * 0.4f, textPaint1);
|
|
|
|
if (((FractionCard)Value.View).Fraction.Denominateur < 10 && ((FractionCard)Value.View).Fraction.Denominateur > 0)
|
|
|
|
if (((FractionCard)Value.View).Fraction.Denominateur < 10 && ((FractionCard)Value.View).Fraction.Denominateur > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, 50, textPaint2);
|
|
|
|
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, 50, textPaint2);
|
|
|
@ -159,7 +159,7 @@ namespace TheGameExtreme.view
|
|
|
|
SKPoint transformedPoint = inverseMatrix.MapPoint(location);
|
|
|
|
SKPoint transformedPoint = inverseMatrix.MapPoint(location);
|
|
|
|
|
|
|
|
|
|
|
|
// Check if it's in the untransformed bitmap rectangle
|
|
|
|
// Check if it's in the untransformed bitmap rectangle
|
|
|
|
SKRect rect = new SKRect(-width, -height - textPaint.TextSize + 10, width + textPaint.MeasureText(display), height + 10);
|
|
|
|
SKRect rect = new SKRect(-width, -height - textPaint.TextSize, width + textPaint.MeasureText(display), height);
|
|
|
|
return rect.Contains(transformedPoint);
|
|
|
|
return rect.Contains(transformedPoint);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|