add reset function on releasing the R key
This commit is contained in:
parent
f1da5df0bc
commit
a561882a53
11
graphics.cpp
11
graphics.cpp
@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "graphics.h"
|
#include "graphics.h"
|
||||||
|
#include "mpreal.h"
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include <SDL2/SDL_pixels.h>
|
#include <SDL2/SDL_pixels.h>
|
||||||
#include <SDL2/SDL_render.h>
|
#include <SDL2/SDL_render.h>
|
||||||
@ -428,6 +429,16 @@ void Graphics::mainLoop()
|
|||||||
this->m_end.x = event.motion.x;
|
this->m_end.x = event.motion.x;
|
||||||
this->m_end.y = event.motion.y;
|
this->m_end.y = event.motion.y;
|
||||||
break;
|
break;
|
||||||
|
case SDL_KEYUP:
|
||||||
|
if (event.key.keysym.scancode == SDL_SCANCODE_R) {
|
||||||
|
mpreal::set_default_prec(mpfr::digits2bits(20));
|
||||||
|
m.f.x = mpreal(-2.0);
|
||||||
|
m.f.y = mpreal(-1.0);
|
||||||
|
m.t.x = mpreal(1.0);
|
||||||
|
m.t.y = mpreal(1.0);
|
||||||
|
m.diff = mpreal(0.0001);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user