From 849904458a65526e50877be65bf6ad0b0acc60ab Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Fri, 20 Jan 2017 21:04:48 +0200 Subject: [PATCH] Map backspace to eraseSurface(). Erase last created. --- .../bin/data/ofxpimapper.xml | 123 +++++++++++++++++- example-custom-shortcuts/src/ofApp.cpp | 2 + 2 files changed, 119 insertions(+), 6 deletions(-) diff --git a/example-custom-shortcuts/bin/data/ofxpimapper.xml b/example-custom-shortcuts/bin/data/ofxpimapper.xml index 356bec7..259e4f7 100644 --- a/example-custom-shortcuts/bin/data/ofxpimapper.xml +++ b/example-custom-shortcuts/bin/data/ofxpimapper.xml @@ -2,16 +2,16 @@ - 400.000000000 - 50.000000000 + 347.000000000 + -19.000000000 - 750.000000000 - 400.000000000 + 697.000000000 + 331.000000000 - 50.000000000 - 400.000000000 + -3.000000000 + 331.000000000 @@ -33,4 +33,115 @@ image1.jpg + + + + 283.000000000 + 34.000000000 + + + 983.000000000 + 34.000000000 + + + 983.000000000 + 384.000000000 + + + 283.000000000 + 384.000000000 + + + + + 0.000000000 + 0.000000000 + + + 1.000000000 + 0.000000000 + + + 1.000000000 + 1.000000000 + + + 0.000000000 + 1.000000000 + + + + none + none + + + 1 + + + + + + 483.000000000 + 325.000000000 + + + 349.666656494 + 100.000000000 + + + 616.333312988 + 100.000000000 + + + 883.000000000 + 325.000000000 + + + 616.333312988 + 550.000000000 + + + 349.666656494 + 550.000000000 + + + 83.000000000 + 325.000000000 + + + + + 0.500000000 + 0.500000000 + + + 0.333333343 + 0.000000000 + + + 0.666666687 + 0.000000000 + + + 1.000000000 + 0.500000000 + + + 0.666666687 + 1.000000000 + + + 0.333333343 + 1.000000000 + + + 0.000000000 + 0.500000000 + + + + none + none + + diff --git a/example-custom-shortcuts/src/ofApp.cpp b/example-custom-shortcuts/src/ofApp.cpp index 0c40da5..554e7e1 100644 --- a/example-custom-shortcuts/src/ofApp.cpp +++ b/example-custom-shortcuts/src/ofApp.cpp @@ -30,6 +30,8 @@ void ofApp::keyPressed(int key){ mapper.createSurface(ofx::piMapper::GRID_WARP_SURFACE); }else if(key == 't'){ mapper.createSurface(ofx::piMapper::TRIANGLE_SURFACE); + }else if(key == OF_KEY_BACKSPACE){ + mapper.eraseSurface(mapper.getNumSurfaces() - 1); }else{ mapper.keyPressed(key); }