- wxWindow *frame = wxTheApp->GetTopWindow();
- wxWindow *canvas = (wxWindow *) NULL;
- if (frame)
- {
- wxNode *node = frame->GetChildren().First();
- if (node) canvas = (wxWindow*)node->Data();
- }
-
- if (m_topCard >= 0)
- {
- if (m_dx == 0 && m_dy == 0)
- {
- if ((canvas) && (canvas->IsExposed(m_x,m_y,60,200)))
- m_cards[m_topCard]->Draw(dc, m_x, m_y);
- }
- else
- {
- int x = m_x;
- int y = m_y;
- for (int i = 0; i <= m_topCard; i++)
- {
- if ((canvas) && (canvas->IsExposed(x,y,60,200)))
- m_cards[i]->Draw(dc, x, y);
- x += m_dx;
- y += m_dy;
- }
- }
- }
- else
- {
- if ((canvas) && (canvas->IsExposed(m_x,m_y,60,200)))
- Card::DrawNullCard(dc, m_x, m_y);
- }
+ FortyFrame *frame = (FortyFrame*) wxTheApp->GetTopWindow();
+ wxWindow *canvas = (wxWindow *) NULL;
+ if (frame)
+ {
+ canvas = frame->GetCanvas();
+ }
+
+ if (m_topCard >= 0)
+ {
+ if (m_dx == 0 && m_dy == 0)
+ {
+ if ((canvas) && (canvas->IsExposed(m_x,m_y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
+ m_cards[m_topCard]->Draw(dc, m_x, m_y);
+ }
+ else
+ {
+ int x = m_x;
+ int y = m_y;
+ for (int i = 0; i <= m_topCard; i++)
+ {
+ if ((canvas) && (canvas->IsExposed(x,y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
+ m_cards[i]->Draw(dc, x, y);
+ x += (int)Card::GetScale()*m_dx;
+ y += (int)Card::GetScale()*m_dy;
+ }
+ }
+ }
+ else
+ {
+ if ((canvas) && (canvas->IsExposed(m_x,m_y,(int)(Card::GetScale()*60),(int)(Card::GetScale()*200))))
+ Card::DrawNullCard(dc, m_x, m_y);
+ }