Changeset 47c62d04 in git for src/gfxcore.cc


Ignore:
Timestamp:
11/03/15 04:27:36 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
5afbd60
Parents:
371f9ed
Message:

src/gfxcore.cc: Refactor code to dispatch drawing of the colour key.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gfxcore.cc

    r371f9ed r47c62d04  
    23882388    // Draw colour key.
    23892389    if (m_ColourKey) {
    2390         if (m_ColourBy == COLOUR_BY_DEPTH) {
    2391             DrawList2D(LIST_DEPTH_KEY, GetXSize() - KEY_OFFSET_X,
    2392                        GetYSize() - KEY_OFFSET_Y, 0);
    2393         } else if (m_ColourBy == COLOUR_BY_DATE) {
    2394             DrawList2D(LIST_DATE_KEY, GetXSize() - KEY_OFFSET_X,
    2395                        GetYSize() - KEY_OFFSET_Y, 0);
    2396         } else if (m_ColourBy == COLOUR_BY_ERROR) {
    2397             DrawList2D(LIST_ERROR_KEY, GetXSize() - KEY_OFFSET_X,
    2398                        GetYSize() - KEY_OFFSET_Y, 0);
    2399         } else if (m_ColourBy == COLOUR_BY_LENGTH) {
    2400             DrawList2D(LIST_LENGTH_KEY, GetXSize() - KEY_OFFSET_X,
     2390        drawing_list key_list = LIST_LIMIT_;
     2391        switch (m_ColourBy) {
     2392            case COLOUR_BY_DEPTH:
     2393                key_list = LIST_DEPTH_KEY; break;
     2394            case COLOUR_BY_DATE:
     2395                key_list = LIST_DATE_KEY; break;
     2396            case COLOUR_BY_ERROR:
     2397                key_list = LIST_ERROR_KEY; break;
     2398            case COLOUR_BY_LENGTH:
     2399                key_list = LIST_LENGTH_KEY; break;
     2400        }
     2401        if (key_list != LIST_LIMIT_) {
     2402            DrawList2D(key_list, GetXSize() - KEY_OFFSET_X,
    24012403                       GetYSize() - KEY_OFFSET_Y, 0);
    24022404        }
Note: See TracChangeset for help on using the changeset viewer.