Commit e32af208 authored by Andreas Kempe's avatar Andreas Kempe

Settings update from zoom now happens on rendering.

Updating of the render settings will now not happen until the render
button is pressed. This will allow the user to redefine the area an
infinite number of times until the render button is pushed.
parent 79e0d716
......@@ -124,6 +124,9 @@ void main_window::send_img_render()
if (!socket)
return;
// Update the render settings.
render_settings = new_render_settings;
QByteArray settings;
QDataStream stream(&settings, QIODevice::ReadWrite);
......@@ -176,15 +179,16 @@ void main_window::handle_mouse_press(QMouseEvent* event)
rect->y() +
rect->rect().height());
render_settings.re_max = real(lower_right);
render_settings.re_min = real(upper_left);
render_settings.im_max = imag(lower_right);
render_settings.im_min = imag(upper_left);
new_render_settings = render_settings;
new_render_settings.re_max = real(lower_right);
new_render_settings.re_min = real(upper_left);
new_render_settings.im_max = imag(lower_right);
new_render_settings.im_min = imag(upper_left);
field_list[0]->setText(QString("%1").arg(render_settings.re_max));
field_list[1]->setText(QString("%1").arg(render_settings.re_min));
field_list[2]->setText(QString("%1").arg(render_settings.im_max));
field_list[3]->setText(QString("%1").arg(render_settings.im_min));
field_list[0]->setText(QString("%1").arg(new_render_settings.re_max));
field_list[1]->setText(QString("%1").arg(new_render_settings.re_min));
field_list[2]->setText(QString("%1").arg(new_render_settings.im_max));
field_list[3]->setText(QString("%1").arg(new_render_settings.im_min));
}
}
......
......@@ -37,6 +37,7 @@ class main_window : public QWidget
// Contains user set settings.
std::vector<QLineEdit*> field_list;
mandel_settings render_settings;
mandel_settings new_render_settings;
bool drawing_rect;
QGraphicsRectItem* rect;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment