예제 #1
0
void RS_ActionDrawText::preparePreview() {
    data.insertionPoint = pos;
    RS_Text* text = new RS_Text(preview, data);
    text->update();
    preview->addEntity(text);
    textChanged = false;
}
예제 #2
0
void RS_ActionDrawText::trigger() {

    RS_DEBUG->print("RS_ActionDrawText::trigger()");

    if (pos.valid) {
        deletePreview();
        clearPreview();
        deleteSnapper();

        RS_Text* text = new RS_Text(container, data);
        text->update();
        container->addEntity(text);

        if (document) {
            document->startUndoCycle();
            document->addUndoable(text);
            document->endUndoCycle();
        }

        graphicView->drawEntity(text);

        textChanged = true;
        setStatus(SetPos);
    }
}
예제 #3
0
void RS_ActionDrawText::preparePreview() {
    clearPreview();
    data.insertionPoint = RS_Vector(0.0,0.0);
    RS_Text* text = new RS_Text(preview, data);
    text->update();
    //text->setVisible(false);
    preview->addEntity(text);
    textChanged = false;
}
예제 #4
0
void RS_ActionDrawText::preparePreview() {
	if (data->halign == RS_TextData::HAFit || data->halign == RS_TextData::HAAligned) {
        if (secPos.valid) {
            RS_Line* text = new RS_Line(pos, secPos);
            preview->addEntity(text);
        }
    } else {
		data->insertionPoint = pos;
		RS_Text* text = new RS_Text(preview.get(), *data);
        text->update();
        preview->addEntity(text);
    }
    textChanged = false;
}
예제 #5
0
void RS_ActionDrawText::trigger() {

    RS_DEBUG->print("RS_ActionDrawText::trigger()");

    if (pos.valid) {
        deletePreview();

		RS_Text* text = new RS_Text(container, *data);
        text->update();
        container->addEntity(text);

        if (document) {
            document->startUndoCycle();
            document->addUndoable(text);
            document->endUndoCycle();
        }

                graphicView->redraw(RS2::RedrawDrawing);

        textChanged = true;
        secPos = RS_Vector(false);
        setStatus(SetPos);
    }
}