Tweaks to visual clip tools

Originally committed to SVN as r1365.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-05 04:56:56 +00:00
parent 570321722b
commit 201a9a4b26
3 changed files with 9 additions and 5 deletions

View file

@ -193,7 +193,7 @@ void Spline::MovePoint(int curveIndex,int point,wxPoint pos) {
SplineCurve *c2 = NULL;
// Indices
int size = curves.size();
//int size = curves.size();
int i0 = curveIndex-1;
int i1 = curveIndex;
int i2 = curveIndex+1;
@ -282,8 +282,11 @@ void Spline::GetPointList(std::vector<wxPoint> &points) {
int y3 = cur->y3;
int y4 = cur->y4;
// Hardcoded at 50 steps for now
int steps = 50;
// Find number of steps
int len = sqrt(double((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2))) + sqrt(double((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3))) + sqrt(double((x3-x4)*(x3-x4)+(y3-y4)*(y3-y4)));
int steps = len/8;
// Render curve
for (int i=0;i<steps;i++) {
// Get t and t-1 (u)
float t = float(i)/float(steps);

View file

@ -86,7 +86,7 @@ void VisualToolClip::Draw() {
int dy2 = curY2;
// Draw rectangle
SetLineColour(colour[3]);
SetLineColour(colour[3],1.0f,2);
SetFillColour(colour[3],0.0f);
DrawRectangle(dx1,dy1,dx2,dy2);

View file

@ -68,7 +68,7 @@ void VisualToolVectorClip::Draw() {
spline.GetPointList(points);
// Draw lines
SetLineColour(colour[3]);
SetLineColour(colour[3],1.0f,2);
SetFillColour(colour[3],0.0f);
for (size_t i=0;i<points.size()-1;i++) {
DrawLine(points[i].x,points[i].y,points[i+1].x,points[i+1].y);
@ -91,6 +91,7 @@ void VisualToolVectorClip::Draw() {
glColorMask(1,1,1,1);
glStencilFunc(GL_EQUAL, 0, 1);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
SetLineColour(colour[3],0.0f);
SetFillColour(wxColour(0,0,0),0.5f);
DrawRectangle(0,0,sw,sh);
glDisable(GL_STENCIL_TEST);