Changeset 1303

Show
Ignore:
Timestamp:
11/05/07 13:49:06 (12 months ago)
Author:
calvin
Message:

pattern editor redraw optimizations

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/buzelib/PatternEditor/PatternEditorInner.cpp

    r1302 r1303  
    109109        int firscliprow = dc.m_rc.top / font_size.cy; 
    110110 
     111        int firstclipcol = ScreenUnitsToCursorColumn(dc.m_rc.left / font_size.cx + scroll.x); 
     112        if (firstclipcol == -1) firstclipcol = cursor_columns.size() - 1; 
     113 
     114        if (firstclipcol > 0) 
     115                firstclipcol = cursor_columns[firstclipcol - 1].column; else 
     116                firstclipcol = 0; 
     117 
     118        int lastclipcol = ScreenUnitsToCursorColumn(dc.m_rc.right / font_size.cx + scroll.x); 
     119        if (lastclipcol == -1) lastclipcol = cursor_columns.size() - 1; 
     120 
     121        if (lastclipcol > 0) 
     122                lastclipcol = cursor_columns[lastclipcol].column; else 
     123                lastclipcol = 0; 
     124        if (lastclipcol >= columns.size()) 
     125                lastclipcol = columns.size() - 1; 
     126 
    111127        for (int i = firscliprow; i <= cliprows && i+scroll.y < rows; i++) { 
    112128                int src_y = (i + scroll.y) * font_size.cy; 
     
    124140                        bkcol = colors[PE_BG]; 
    125141 
    126                 for (int j = 0; j<columns.size(); j++) { 
     142                for (int j = firstclipcol; j <= lastclipcol; j++) { 
    127143                        dc.SetBkColor(bkcol); 
    128144