@ -216,16 +216,25 @@ namespace TheGameExtreme.view
stackCollection . Clear ( ) ;
stackCollection . Clear ( ) ;
SKPaint textPaint = new SKPaint ( ) ;
SKPaint textPaint = new SKPaint ( ) ;
float textWidth = textPaint . MeasureText ( "001" ) ;
SKPoint position = new SKPoint ( ( float ) ( ( DeviceDisplay . MainDisplayInfo . Width * 0.9 ) / ( viewmodel . getListOrderedStacks ( ) . Count * 2 ) ) + ( float ) ( DeviceDisplay . MainDisplayInfo . Width * 0.01 ) , ( float ) ( ( DeviceDisplay . MainDisplayInfo . Height * 0.1 ) + ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.01 + 2 * ( 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textPaint . MeasureText ( "001" ) ) ) ) ;
float textSize = 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textWidth ;
SKPoint position = new SKPoint ( ( float ) ( ( DeviceDisplay . MainDisplayInfo . Width * 0.9 ) / ( viewmodel . getListOrderedStacks ( ) . Count * 2 ) ) - textPaint . MeasureText ( "01" ) * 0.5f , ( float ) ( ( DeviceDisplay . MainDisplayInfo . Height * 0.1 ) + ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.01 + 2 * textSize ) ) ;
float inflateWidth ;
if ( indexMode = = 4 )
{
inflateWidth = 0.01f * ( float ) DeviceDisplay . MainDisplayInfo . Width ;
}
else
{
inflateWidth = 0.02f * ( float ) DeviceDisplay . MainDisplayInfo . Width ;
}
for ( int i = 0 ; i < viewmodel . getListOrderedStacks ( ) . Count ; i + + )
for ( int i = 0 ; i < viewmodel . getListOrderedStacks ( ) . Count ; i + + )
{
{
textPaint = new SKPaint ( ) ;
textPaint = new SKPaint ( ) ;
textPaint . TextSize = textSize ;
textPaint . TextSize = 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textPaint . MeasureText ( "000" ) ;
position . X - = textPaint . MeasureText ( viewmodel . getListOrderedStacks ( ) [ i ] . Peek ( ) . Value . ToString ( ) ) * 0.5f ;
stackCollection . Add ( new TouchManipulationCard ( textPaint , viewmodel . getListOrderedStacks ( ) [ i ] . Peek ( ) )
stackCollection . Add ( new TouchManipulationCard ( textPaint , viewmodel . getListOrderedStacks ( ) [ i ] . Peek ( ) , inflateWidth )
{
{
Matrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
Matrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
InitialMatrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
InitialMatrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
@ -243,17 +252,26 @@ namespace TheGameExtreme.view
private void InflateHand ( )
private void InflateHand ( )
{
{
SKPaint textPaint = new SKPaint ( ) ;
SKPaint textPaint = new SKPaint ( ) ;
float textWidth = textPaint . MeasureText ( "001" ) ;
SKPoint position = new SKPoint ( ( float ) ( ( DeviceDisplay . MainDisplayInfo . Width * 0.9 ) / ( viewmodel . CurrentHand . Count * 2 ) ) + ( float ) ( DeviceDisplay . MainDisplayInfo . Width * 0.01 ) , ( float ) ( ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) - ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.1 - 2 * ( 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textPaint . MeasureText ( "001" ) ) ) ) ;
float textSize = 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textWidth ;
SKPoint position = new SKPoint ( ( float ) ( ( DeviceDisplay . MainDisplayInfo . Width * 0.9 ) / ( viewmodel . CurrentHand . Count * 2 ) ) - textPaint . MeasureText ( "01" ) * 0.5f + ( float ) ( DeviceDisplay . MainDisplayInfo . Width * 0.01 ) , ( float ) ( ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) - ( DeviceDisplay . MainDisplayInfo . Height * 0.9 ) * 0.1 - 2 * textSize ) ) ;
float inflateWidth ;
if ( indexMode = = 4 )
{
inflateWidth = 0.01f * ( float ) DeviceDisplay . MainDisplayInfo . Width ;
}
else
{
inflateWidth = 0.015f * ( float ) DeviceDisplay . MainDisplayInfo . Width ;
}
for ( int i = 0 ; i < viewmodel . CurrentHand . Count ; i + + )
for ( int i = 0 ; i < viewmodel . CurrentHand . Count ; i + + )
{
{
textPaint = new SKPaint ( ) ;
textPaint = new SKPaint ( ) ;
textPaint . TextSize = textSize ;
float textWidth = textPaint . MeasureText ( viewmodel . CurrentHand [ i ] . Value . ToString ( ) ) ;
textPaint . TextSize = 0.05f * ( float ) DeviceDisplay . MainDisplayInfo . Width * textPaint . TextSize / textPaint . MeasureText ( "000" ) ;
position . X - = ( float ) ( textWidth * 0.5 ) ;
position . X - = ( float ) ( textWidth * 0.5 ) ;
textCollection . Add ( new TouchManipulationCard ( textPaint , viewmodel . CurrentHand [ i ] )
textCollection . Add ( new TouchManipulationCard ( textPaint , viewmodel . CurrentHand [ i ] , inflateWidth )
{
{
Matrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
Matrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
InitialMatrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,
InitialMatrix = SKMatrix . MakeTranslation ( position . X , position . Y ) ,