- ay=atof(tokens.at(i).data());
- actual_x=ax;
- actual_y=ay;
- //mtx
- if(mtx) transformPoint2D(mtx,&ax,&ay);
- //adjust
- coor2vect(&ax,&ay);
- //save
- setTg2(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- if(isFirst(k1.front(),ax,ay)){
- setTg1(k1.front(),k1.front()->x,k1.front()->y,k1.front()->x,k1.front()->y);
- }else{
- k1.push_back(newVertice(ax,ay));
- setTg1(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- }
- }else if(tokens.at(i).compare("l")==0){//relative line to
- //point read
- i++; ax=atof(tokens.at(i).data());
- i++; if(tokens.at(i).compare(",")==0) i++;
- ay=atof(tokens.at(i).data());
- //relative
- ax=actual_x+ax;
- ay=actual_y+ay;
- actual_x=ax;
- actual_y=ay;
- //mtx
- if(mtx) transformPoint2D(mtx,&ax,&ay);
- //adjust
- coor2vect(&ax,&ay);
- //save
- setTg2(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- if(isFirst(k1.front(),ax,ay)){
- setTg1(k1.front(),k1.front()->x,k1.front()->y,k1.front()->x,k1.front()->y);
- }else{
- k1.push_back(newVertice(ax,ay));
- setTg1(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- }
- }else if(tokens.at(i).compare("H")==0){//absolute horizontal move
- //the same that L but only Horizontal movement
- //point
- i++; ax=atof(tokens.at(i).data());
- ay=actual_y;
- actual_x=ax;
- actual_y=ay;
- //mtx
- if(mtx) transformPoint2D(mtx,&ax,&ay);
- //adjust
- coor2vect(&ax,&ay);
- //save
- setTg2(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- if(isFirst(k1.front(),ax,ay)){
- setTg1(k1.front(),k1.front()->x,k1.front()->y,k1.front()->x,k1.front()->y);
- }else{
- k1.push_back(newVertice(ax,ay));
- setTg1(k1.back(),k1.back()->x,k1.back()->y,k1.back()->x,k1.back()->y);
- }
- }else if(tokens.at(i).compare("h")==0){//horizontal relative
- i++; ax=atof(tokens.at(i).data());
- ax=actual_x+ax;