Open hkajava opened 6 years ago
get rid of this in RandomizeStudentGroup.jsx
// TODO: get rid of this!. For some bizarre reason there is vertical offset when rendering // actual groups with a logged-in user and students coming from database... // UPDATE 2018-04-24: investigated for an hour. no luck. for some reason GSAP // does wrong transform matrix when user is logged-in. Did debug a little inside // GSAP but no luck yet. Somehow the coordinate system context gets switched // inside GSAP if (this.props.currentUser.user !== 'exampleUser') { newRelativeStudentNamePositionY -= globalAwfulHackOffsetY; }
Made a workaround. Root cause to be found. A very nice challenge!!
This part of RandomizeStudentGroup should be fixed: // TODO: get rid of this!. For some bizarre reason there is vertical offset when rendering // actual groups with a logged-in user and students coming from database... // UPDATE 2018-04-24: investigated for an hour. no luck. for some reason GSAP // does wrong transform matrix when user is logged-in. Did debug a little inside // GSAP but no luck yet. Somehow the coordinate system context gets switched // inside GSAP if (this.props.currentUser.user !== 'exampleUser') { newRelativeStudentNamePositionY -= globalAwfulHackOffsetY;
const longestArrayIndex =
this.state.randomizedStudentArrayOfArrays.reduce(function(maxI, el, i, arr) {
return el.length > arr[maxI].length ? i : maxI;
}, 0);
const longestArrayLength =
this.state.randomizedStudentArrayOfArrays[longestArrayIndex].length;
if (this.state.randomizedStudentArrayOfArrays[smallGroupNbr - 1].length < longestArrayLength) {
// TODO: get rid of this! another horrible hack, root cause probably related
newRelativeStudentNamePositionY += 50;
}
}
moving this ticket forward into Iteration 2/2018
For some weird reason the student names get misaligned after login like this (group 3):