MEMSET was clearing the TransInfo struct after the constraint setup call has been made. Temporary fix until the manipulator transform init is split off, like normal transform.
This commit is contained in:
@@ -211,6 +211,8 @@ typedef struct TransInfo {
|
|||||||
#define TD_NOTCONNECTED 8
|
#define TD_NOTCONNECTED 8
|
||||||
#define TD_SINGLESIZE 16 /* used for scaling of MetaElem->rad */
|
#define TD_SINGLESIZE 16 /* used for scaling of MetaElem->rad */
|
||||||
|
|
||||||
|
void checkFirstTime(void);
|
||||||
|
|
||||||
void initWarp(TransInfo *t);
|
void initWarp(TransInfo *t);
|
||||||
int Warp(TransInfo *t, short mval[2]);
|
int Warp(TransInfo *t, short mval[2]);
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,11 @@ static char *transform_to_undostr(TransInfo *t)
|
|||||||
|
|
||||||
/* ************************************************* */
|
/* ************************************************* */
|
||||||
|
|
||||||
|
void checkFirstTime() {
|
||||||
|
if(Trans.mode==TFM_INIT)
|
||||||
|
memset(&Trans, 0, sizeof(TransInfo));
|
||||||
|
}
|
||||||
|
|
||||||
void transformEvent(unsigned short event, short val) {
|
void transformEvent(unsigned short event, short val) {
|
||||||
float mati[3][3];
|
float mati[3][3];
|
||||||
char cmode = constraintModeToChar(&Trans);
|
char cmode = constraintModeToChar(&Trans);
|
||||||
@@ -431,7 +436,7 @@ void transformEvent(unsigned short event, short val) {
|
|||||||
|
|
||||||
void initTransform(int mode, int context) {
|
void initTransform(int mode, int context) {
|
||||||
/* added initialize, for external calls to set stuff in TransInfo, like undo string */
|
/* added initialize, for external calls to set stuff in TransInfo, like undo string */
|
||||||
if(Trans.mode==TFM_INIT) memset(&Trans, 0, sizeof(TransInfo));
|
checkFirstTime();
|
||||||
|
|
||||||
Trans.state = TRANS_RUNNING;
|
Trans.state = TRANS_RUNNING;
|
||||||
|
|
||||||
@@ -596,9 +601,6 @@ void ManipulatorTransform(int mode)
|
|||||||
short pmval[2] = {0, 0}, mval[2], val;
|
short pmval[2] = {0, 0}, mval[2], val;
|
||||||
unsigned short event;
|
unsigned short event;
|
||||||
|
|
||||||
/* added initialize, for external calls to set stuff in TransInfo, like undo string */
|
|
||||||
if(Trans.mode==TFM_INIT) memset(&Trans, 0, sizeof(TransInfo));
|
|
||||||
|
|
||||||
Trans.state = TRANS_RUNNING;
|
Trans.state = TRANS_RUNNING;
|
||||||
|
|
||||||
/* stupid PET initialisation code */
|
/* stupid PET initialisation code */
|
||||||
|
|||||||
@@ -1463,7 +1463,7 @@ int BIF_do_manipulator(ScrArea *sa)
|
|||||||
// find the hotspots first test narrow hotspot
|
// find the hotspots first test narrow hotspot
|
||||||
val= manipulator_selectbuf(sa, 0.5f*(float)U.tw_hotspot);
|
val= manipulator_selectbuf(sa, 0.5f*(float)U.tw_hotspot);
|
||||||
if(val) {
|
if(val) {
|
||||||
|
checkFirstTime(); // TEMPORARY, check this before doing any transform call.
|
||||||
// drawflags still global, for drawing call above
|
// drawflags still global, for drawing call above
|
||||||
drawflags= manipulator_selectbuf(sa, 0.2f*(float)U.tw_hotspot);
|
drawflags= manipulator_selectbuf(sa, 0.2f*(float)U.tw_hotspot);
|
||||||
if(drawflags==0) drawflags= val;
|
if(drawflags==0) drawflags= val;
|
||||||
|
|||||||
Reference in New Issue
Block a user