Changeset 127435f in git


Ignore:
Timestamp:
04/07/19 03:15:27 (3 months ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
d034033
Parents:
ead0c22
git-author:
Olly Betts <olly@…> (04/07/19 03:04:03)
git-committer:
Olly Betts <olly@…> (04/07/19 03:15:27)
Message:

Draw the measuring line ring with an even shape

Previously the exact shape of the ring varied slightly depending on
the exact coordinates, which could be visually distracting once you
noticed it.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/TODO.htm

    read0c22 r127435f  
    5050with a copy from the back buffer and redraw it in the new position without a
    5151re-render.
    52 
    53 <li>Round the measuring line coords so the ring is a nice shape?  Or just
    54 antialias the ring, "there" blob and line?
    5552
    5653<li>Process all pending input before rerendering to improve responsiveness.
  • src/gla-gl.cc

    read0c22 r127435f  
    14171417void GLACanvas::DrawRing(glaCoord x, glaCoord y)
    14181418{
    1419     // Draw an unfilled circle
    1420     const Double radius = 4;
    1421     assert(m_Quadric);
    1422     glMatrixMode(GL_MODELVIEW);
    1423     CHECK_GL_ERROR("DrawRing", "glMatrixMode");
    1424     glPushMatrix();
    1425     CHECK_GL_ERROR("DrawRing", "glPushMatrix");
    1426     glTranslated(x, y, 0.0);
    1427     CHECK_GL_ERROR("DrawRing", "glTranslated");
    1428     gluDisk(m_Quadric, radius - 1.0, radius, 12, 1);
    1429     CHECK_GL_ERROR("DrawRing", "gluDisk");
    1430     glPopMatrix();
    1431     CHECK_GL_ERROR("DrawRing", "glPopMatrix");
     1419    // Draw an unfilled circle of radius 4
     1420
     1421    // Round to integers to get an even ring.
     1422    x = rint(x);
     1423    y = rint(y);
     1424
     1425    glBegin(GL_LINE_LOOP);
     1426    PlaceIndicatorVertex(x + 3.5, y - 1.5);
     1427    PlaceIndicatorVertex(x + 1.5, y - 3.5);
     1428    PlaceIndicatorVertex(x - 1.5, y - 3.5);
     1429    PlaceIndicatorVertex(x - 3.5, y - 1.5);
     1430    PlaceIndicatorVertex(x - 3.5, y + 1.5);
     1431    PlaceIndicatorVertex(x - 1.5, y + 3.5);
     1432    PlaceIndicatorVertex(x + 1.5, y + 3.5);
     1433    PlaceIndicatorVertex(x + 3.5, y + 1.5);
     1434    glEnd();
     1435    CHECK_GL_ERROR("DrawRing", "glEnd GL_LINE_LOOP");
    14321436}
    14331437
Note: See TracChangeset for help on using the changeset viewer.