- clipped selection circle in colorpicker to prevent it drawing outside

the color plane
- removed warnings from glutil.c, made circleXOR call become float instead
  of short
- fixed error in drawing text of buttons in pop-up menus, when zoomed small
This commit is contained in:
Ton Roosendaal 2004-07-05 10:22:00 +00:00
parent 3cade4dad6
commit a910ff343e
4 changed files with 19 additions and 13 deletions

@ -341,11 +341,11 @@ void draw_sel_circle(short *mval, short *mvalo, float rad, float rado, int selec
/* draw circle */
if(mvalo && no_mvalo==0) {
sdrawXORcirc(mvalo[0], mvalo[1], rado);
fdrawXORcirc(mvalo[0], mvalo[1], rado);
}
if(mval) {
sdrawXORcirc(mval[0], mval[1], rad);
fdrawXORcirc(mval[0], mval[1], rad);
}
glFlush();

@ -137,13 +137,13 @@ void sdrawXORline4(int nr, int x0, int y0, int x1, int y1)
set_inverted_drawing(0);
}
void sdrawXORcirc(short xofs, short yofs, float rad)
void fdrawXORcirc(float xofs, float yofs, float rad)
{
set_inverted_drawing(1);
glPushMatrix();
glTranslatef(xofs, yofs, 0.0);
glutil_draw_lined_arc(0.0, M_PI*2, rad, 20);
glutil_draw_lined_arc(0.0, M_PI*2.1, rad, 20);
glPopMatrix();
set_inverted_drawing(0);
@ -178,14 +178,14 @@ void glutil_draw_lined_arc(float start, float angle, float radius, int nsegments
int glaGetOneInteger(int param)
{
int i;
GLint i;
glGetIntegerv(param, &i);
return i;
}
float glaGetOneFloat(int param)
{
float v;
GLfloat v;
glGetFloatv(param, &v);
return v;
}
@ -209,7 +209,7 @@ void glaRasterPosSafe2f(float x, float y, float known_good_x, float known_good_y
static int get_cached_work_texture(int *w_r, int *h_r)
{
static int texid= -1;
static GLint texid= -1;
static int tex_w= 256;
static int tex_h= 256;
@ -366,10 +366,10 @@ gla2DDrawInfo *glaBegin2DDraw(rcti *screen_rect, rctf *world_rect)
int sc_w, sc_h;
float wo_w, wo_h;
glGetIntegerv(GL_VIEWPORT, di->orig_vp);
glGetIntegerv(GL_SCISSOR_BOX, di->orig_sc);
glGetFloatv(GL_PROJECTION_MATRIX, di->orig_projmat);
glGetFloatv(GL_MODELVIEW_MATRIX, di->orig_viewmat);
glGetIntegerv(GL_VIEWPORT, (GLint *)di->orig_vp);
glGetIntegerv(GL_SCISSOR_BOX, (GLint *)di->orig_sc);
glGetFloatv(GL_PROJECTION_MATRIX, (GLfloat *)di->orig_projmat);
glGetFloatv(GL_MODELVIEW_MATRIX, (GLfloat *)di->orig_viewmat);
di->screen_rect= *screen_rect;
if (world_rect) {

@ -477,6 +477,8 @@ static void ui_positionblock(uiBlock *block, uiBut *but)
bt->y2 += yof;
bt->aspect= 1.0;
// check_but recalculates drawstring size in pixels
ui_check_but(bt);
bt= bt->next;
}

@ -1579,8 +1579,12 @@ static void ui_draw_but_HSVCUBE(uiBut *but)
glShadeModel(GL_FLAT);
/* cursor */
sdrawXORcirc((short)(but->x1 + x*(but->x2-but->x1)),
(short)(but->y1 + y*(but->y2-but->y1)), 3.0);
x= but->x1 + x*(but->x2-but->x1);
y= but->y1 + y*(but->y2-but->y1);
CLAMP(x, but->x1+3.0, but->x2-3.0);
CLAMP(y, but->y1+3.0, but->y2-3.0);
fdrawXORcirc(x, y, 3.0);
/* outline */
glColor3ub(0, 0, 0);