Ejemplo n.º 1
0
void RS_ActionDrawMText::preparePreview() {
	data->insertionPoint = *pos;
	RS_MText* text = new RS_MText(preview.get(), *data);
    text->update();
    preview->addEntity(text);
    textChanged = false;
}
Ejemplo n.º 2
0
void RS_ActionDrawMText::trigger() {

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

	if (pos->valid) {
        deletePreview();

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

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

                graphicView->redraw(RS2::RedrawDrawing);

        textChanged = true;
		setStatus(SetPos);
    }
}