Fixed copying of video coordinates to clipboard.

Originally committed to SVN as r1934.
This commit is contained in:
Rodrigo Braz Monteiro 2008-03-06 23:27:54 +00:00
parent 03d4f3fc94
commit b19737c628
2 changed files with 7 additions and 2 deletions

View file

@ -458,6 +458,10 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
// Locked?
if (locked) return;
// Mouse coordinates
mouse_x = event.GetX();
mouse_y = event.GetY();
// Disable when playing
if (VideoContext::Get()->IsPlaying()) return;
@ -643,8 +647,8 @@ void VideoDisplay::OnCopyCoords(wxCommandEvent &event) {
if (wxTheClipboard->Open()) {
int sw,sh;
VideoContext::Get()->GetScriptSize(sw,sh);
int vx = (sw * visual->mouseX + w/2) / w;
int vy = (sh * visual->mouseY + h/2) / h;
int vx = (sw * mouse_x + w/2) / w;
int vy = (sh * mouse_y + h/2) / h;
wxTheClipboard->SetData(new wxTextDataObject(wxString::Format(_T("%i,%i"),vx,vy)));
wxTheClipboard->Close();
}

View file

@ -73,6 +73,7 @@ private:
wxSize origSize;
int w,h;
int dx1,dx2,dy1,dy2;
int mouse_x,mouse_y;
bool locked;
void DrawTVEffects();