Skip to content

Commit

Permalink
properly add texts
Browse files Browse the repository at this point in the history
  • Loading branch information
hkiel committed Mar 28, 2017
1 parent 690e832 commit 671dd86
Show file tree
Hide file tree
Showing 9 changed files with 477 additions and 803 deletions.
8 changes: 0 additions & 8 deletions OMNotebook/OMNotebookGUI/Resources/nls/OMNotebook_de_DE.ts
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<context>
<name>CustomDialog</name>
<message>
<location filename="../../../OMSketch/CustomDailog.cpp" line="99"/>
<source>Styles</source>
<translation>Stile</translation>
</message>
</context>
<context>
<name>IAEX::AboutDialog</name>
<message>
Expand Down
78 changes: 32 additions & 46 deletions OMNotebook/OMSketch/Draw_Rectangle.cpp
@@ -1,62 +1,51 @@
#include "Draw_Rectangle.h"

Draw_Rectangle::Draw_Rectangle()
{
draw_state=0;
draw_mode=false;
angle=0;
//setFlag(QGraphicsItem::ItemIsSelectable,true);
Draw_Rectangle::Draw_Rectangle(){
draw_state=0;
draw_mode=false;
angle=0;
//setFlag(QGraphicsItem::ItemIsSelectable,true);

pen = QPen();
pen.setColor(QColor(0,0,0));
pen.setStyle(Qt::SolidLine);
pen.setWidth(1);
pen = QPen();
pen.setColor(QColor(0,0,0));
pen.setStyle(Qt::SolidLine);
pen.setWidth(1);

brush = QBrush();
brush.setColor(QColor(255,255,255));
brush.setStyle(Qt::NoBrush);
brush = QBrush();
brush.setColor(QColor(255,255,255));
brush.setStyle(Qt::NoBrush);

isObjectSelected=false;

}


void Draw_Rectangle::setStartPoint(QPointF strt_pnt)
{
StrtPnt=strt_pnt;
void Draw_Rectangle::setStartPoint(QPointF strt_pnt) {
StrtPnt=strt_pnt;
}

void Draw_Rectangle::setEndPoint(QPointF lst_pnt)
{
EndPnt=lst_pnt;
void Draw_Rectangle::setEndPoint(QPointF lst_pnt) {
EndPnt=lst_pnt;
}

QPainterPath Draw_Rectangle::getRect(QPointF pnt,QPointF pnt1) {
StrtPnt=pnt;
EndPnt=pnt1;
QPainterPath path;
path.addRect(QRectF(StrtPnt,EndPnt));

QPainterPath Draw_Rectangle::getRect(QPointF pnt,QPointF pnt1)
{
StrtPnt=pnt;
EndPnt=pnt1;
QPainterPath path;
path.addRect(QRectF(StrtPnt,EndPnt));

return path;
return path;
}

QPainterPath Draw_Rectangle::getRotRect(QPointF pnt,QPointF pnt1)
{
StrtPnt=pnt;
EndPnt=pnt1;
QPainterPath path;
qDebug()<<"roated point "<<pnt<<"\n";
path.addRect(QRectF(pnt,EndPnt));
qDebug()<<"rectangle points "<<path.boundingRect().left()<<" "<<path.boundingRect().bottom()<<" "<<path.boundingRect().right()<<"\n";
return path;
QPainterPath Draw_Rectangle::getRotRect(QPointF pnt,QPointF pnt1) {
StrtPnt=pnt;
EndPnt=pnt1;
QPainterPath path;
//qDebug()<<"roated point "<<pnt<<"\n";
path.addRect(QRectF(pnt,EndPnt));
//qDebug()<<"rectangle points "<<path.boundingRect().left()<<" "<<path.boundingRect().bottom()<<" "<<path.boundingRect().right()<<"\n";
return path;
}


void Draw_Rectangle::drawImage(QPainter *painter,QString &text,QPointF point)
{

void Draw_Rectangle::drawImage(QPainter *painter,QString &text,QPointF point) {
QString str_x,str_y,str_x1,str_y1;
QString color_r,color_g,color_b;
QPointF pnt,pnt1;
Expand All @@ -70,10 +59,7 @@ void Draw_Rectangle::drawImage(QPainter *painter,QString &text,QPointF point)

pnt+=point;
pnt1+=point;
}

if(!item->rotation()==0)
{
} else {
pnt=item->boundingRect().topLeft();
pnt1=item->boundingRect().bottomRight();

Expand Down

0 comments on commit 671dd86

Please sign in to comment.