git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35468
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxPoint pt2 = (selTo == wxDefaultPosition) ?
wxPoint(m_Width, wxDefaultCoord) : selTo - GetAbsPos();
wxPoint pt2 = (selTo == wxDefaultPosition) ?
wxPoint(m_Width, wxDefaultCoord) : selTo - GetAbsPos();
unsigned len = m_Word.length();
unsigned i = 0;
pos1 = 0;
unsigned len = m_Word.length();
unsigned i = 0;
pos1 = 0;
pt1.x = 0;
if ( pt2.y >= m_Height )
pt2.x = m_Width;
pt1.x = 0;
if ( pt2.y >= m_Height )
pt2.x = m_Width;
+
+ // before selection:
+#ifdef __WXMAC__
// implementation using PartialExtents to support fractional widths
wxArrayInt widths ;
dc.GetPartialTextExtents(m_Word,widths) ;
// implementation using PartialExtents to support fractional widths
wxArrayInt widths ;
dc.GetPartialTextExtents(m_Word,widths) ;
-#endif
-
- // before selection:
-#ifdef __WXMAC__
while( i < len && pt1.x >= widths[i] )
i++ ;
while( i < len && pt1.x >= widths[i] )
i++ ;
+#else // __WXMAC__
+ wxCoord charW, charH;
while ( pt1.x > 0 && i < len )
{
dc.GetTextExtent(m_Word[i], &charW, &charH);
while ( pt1.x > 0 && i < len )
{
dc.GetTextExtent(m_Word[i], &charW, &charH);
+#endif // __WXMAC__/!__WXMAC__
// in selection:
unsigned j = i;
// in selection:
unsigned j = i;
while( j < len && pt2.x >= widths[j] )
j++ ;
while( j < len && pt2.x >= widths[j] )
j++ ;
pos2 = pos1;
pt2.x -= pos2;
while ( pt2.x > 0 && j < len )
pos2 = pos1;
pt2.x -= pos2;
while ( pt2.x > 0 && j < len )
+#endif // __WXMAC__/!__WXMAC__
dc.SetPen(*wxRED_PEN);
dc.DrawRectangle(x+m_PosX,y+m_PosY,m_Width,m_Height);
#endif
dc.SetPen(*wxRED_PEN);
dc.DrawRectangle(x+m_PosX,y+m_PosY,m_Width,m_Height);
#endif
int xlocal = x + m_PosX;
int ylocal = y + m_PosY;
int xlocal = x + m_PosX;
int ylocal = y + m_PosY;
// draw container's contents:
for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext())
{
// draw container's contents:
for (wxHtmlCell *cell = m_Cells; cell; cell = cell->GetNext())
{
// optimize drawing: don't render off-screen content:
if ((ylocal + cell->GetPosY() <= view_y2) &&
(ylocal + cell->GetPosY() + cell->GetHeight() > view_y1))
// optimize drawing: don't render off-screen content:
if ((ylocal + cell->GetPosY() <= view_y2) &&
(ylocal + cell->GetPosY() + cell->GetHeight() > view_y1))