@@ -226,6 +226,34 @@ void PlaybackSegment::drawImGui()
226226 if (ImGui::Button (" Delete" )) deleteSelf ();
227227
228228 ImGui::ColorEdit3 (" Color" , &jointColor[0 ]);
229+
230+ float range = 300 ;
231+ if (ImGui::SliderFloat2 (" Position" , &position[0 ], -range, range)) saveCache ();
232+
233+ ofRectangle rct;
234+ ImGui::BeginChild (getName ().c_str (), ImVec2 (0 ,100 ), false , ImGuiWindowFlags_NoScrollWithMouse);
235+ {
236+ rct.x = ImGui::GetWindowPos ().x ;
237+ rct.y = ImGui::GetWindowPos ().y ;
238+ rct.width = ImGui::GetWindowSize ().x ;
239+ rct.height = ImGui::GetWindowSize ().y ;
240+
241+ if (ImGui::IsWindowHovered ())
242+ {
243+ CameraManager::instance ().setEnableInteractiveCamera (false );
244+ if (ofGetMousePressed ())
245+ {
246+ position.set (ofMap (ofGetMouseX (), rct.x , rct.x + rct.width , -range, range, true ),
247+ ofMap (ofGetMouseY (), rct.y , rct.y + rct.height , -range, range, true ));
248+ }
249+ }
250+ }
251+ ImGui::EndChild ();
252+ ofSetColor (255 );
253+ ofDrawLine (rct.x + ofMap (position.x , -range, range, 0 , rct.width ), rct.y ,
254+ rct.x + ofMap (position.x , -range, range, 0 , rct.width ), rct.y + rct.height );
255+ ofDrawLine (rct.x , rct.y + ofMap (position.y , -range, range, 0 , rct.height ),
256+ rct.x + rct.width , rct.y + ofMap (position.y , -range, range, 0 , rct.height ));
229257 }
230258 ImGui::PopStyleColor ();
231259 ImGui::PopID ();
0 commit comments