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

View file

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