Visu fraction + placement

master
cldupland 5 years ago
parent ae6c4878ce
commit 2f26718dac

@ -200,7 +200,7 @@ namespace TheGameExtreme.view
float inflateWidth;
if (indexMode == 4 || indexMode == 3)
{
inflateWidth = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width;
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
}
else
{
@ -222,7 +222,7 @@ namespace TheGameExtreme.view
else if (indexMode == 4)
{
textWidth = textPaint.MeasureText("0000");
textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
}
else
{
@ -254,7 +254,7 @@ namespace TheGameExtreme.view
float inflateWidth;
if (indexMode == 4 || indexMode == 3)
{
inflateWidth = 0.01f * (float)DeviceDisplay.MainDisplayInfo.Width;
inflateWidth = 0.03f * (float)DeviceDisplay.MainDisplayInfo.Width;
}
else
{
@ -276,7 +276,7 @@ namespace TheGameExtreme.view
else if (indexMode == 4)
{
textWidth = textPaint.MeasureText("0000");
textPaint.TextSize = 0.038f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
textPaint.TextSize = 0.04f * (float)DeviceDisplay.MainDisplayInfo.Width * textPaint.TextSize / textPaint.MeasureText("0000");
}
else
{

@ -109,20 +109,20 @@ namespace TheGameExtreme.view
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(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, - textPaint.TextSize * 0.5f - height * 0.5f, textPaint);
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(), 0, - textPaint.TextSize * 0.5f - height * 0.5f, textPaint);
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(), textPaint.MeasureText(((FractionCard)Value.View).Fraction.Denominateur.ToString()) * 0.5f, height * 0.5f, textPaint2);
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(), 0, 50, textPaint2);
canvas.DrawText(((FractionCard)Value.View).Fraction.Denominateur.ToString(), width * 0.5f - textPaint.MeasureText(((FractionCard)Value.View).Fraction.Numerateur.ToString()) * 0.5f, 50, textPaint2);
}
}
else

Loading…
Cancel
Save