- calculation of position within HSVCUBE button (picker) had wrong Y

coordinate, only noticable in Panel versions of picker

- the fix to give Transform properties new name "Paint" can't
  work with this code... this due to fact that panel positions are saved
  in files or looked up on re-open based on their names. Giving the Panel
  a new new name then causes it jump to another position, and back on end
  of painting.
  Needs to be solved in another way. Not feasible for 2.34...
This commit is contained in:
Ton Roosendaal 2004-07-31 22:05:46 +00:00
parent 8c1b11286c
commit 8224b1b164
2 changed files with 6 additions and 6 deletions

@ -1493,11 +1493,10 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(VIEW3D_HANDLER_OBJECT); // for close and esc
if ((ob!=G.obedit) && (G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))) {
if(uiNewPanel(curarea, block, "Paint", "View3d", 10, 230, 318, 204)==0) return;
} else {
if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
}
/* (ton) can't use the rename trick for paint... panel names and settings are stored in the files and
used to find previous locations when re-open. This causes flipping */
if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
if((G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))==0) {
uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 18.0, 0, 0, "");

@ -2317,9 +2317,10 @@ static int ui_do_but_HSVCUBE(uiBut *but)
/* relative position within box */
x= ((float)mval[0]-but->x1)/(but->x2-but->x1);
y= ((float)mval[1]-but->y1)/(but->x2-but->x1);
y= ((float)mval[1]-but->y1)/(but->y2-but->y1);
/* we're hacking values now to prevent rgb_to_hsv working wrong */
/* (ton) doesnt work yet... */
CLAMP(x, 0.0005, 0.9995);
CLAMP(y, 0.0005, 0.9995);