Fix bad coordinate conversion in the clip visual tool

Originally committed to SVN as r4315.
This commit is contained in:
Thomas Goyne 2010-05-20 08:55:18 +00:00
parent 0e527355eb
commit 2ec4a97dbb
3 changed files with 10 additions and 10 deletions

View file

@ -100,6 +100,7 @@ private:
/// DOCME
VisualToolEvent eventSink;
int GetHighlightedFeature();
protected:
/// DOCME
VideoDisplay *parent;
@ -165,12 +166,10 @@ protected:
void GetLineScale(AssDialogue *diag,float &scalX,float &scalY);
void GetLineClip(AssDialogue *diag,int &x1,int &y1,int &x2,int &y2,bool &inverse);
wxString GetLineVectorClip(AssDialogue *diag,int &scale,bool &inverse);
void FillPositionData();
void SetOverride(wxString tag,wxString value);
AssDialogue *GetActiveDialogueLine();
int GetHighlightedFeature();
void DrawAllFeatures();
void Commit(bool full=false);
@ -252,7 +251,7 @@ public:
/// @brief DOCME
/// @param event
///
virtual void OnSubTool(wxCommandEvent &event) {}
virtual void OnSubTool(wxCommandEvent &) {}
virtual void Update() { };
virtual void Draw()=0;
void Refresh();

View file

@ -144,12 +144,13 @@ void VisualToolClip::UpdateHold() {
/// @brief Commit hold
///
void VisualToolClip::CommitHold() {
parent->ToScriptCoords(&curX1, &curY1);
parent->ToScriptCoords(&curX2, &curY2);
if (inverse)
SetOverride(L"\\iclip",wxString::Format(L"(%i,%i,%i,%i)",curX1,curY1,curX2,curY2));
else
SetOverride(L"\\clip",wxString::Format(L"(%i,%i,%i,%i)",curX1,curY1,curX2,curY2));
int x1 = curX1;
int x2 = curX2;
int y1 = curY1;
int y2 = curY2;
parent->ToScriptCoords(&x1, &y1);
parent->ToScriptCoords(&x2, &y2);
SetOverride(GetActiveDialogueLine(), inverse ? L"\\iclip" : L"\\clip",wxString::Format(L"(%i,%i,%i,%i)",x1,y1,x2,y2));
}

View file

@ -147,7 +147,7 @@ void VisualToolRotateZ::Draw() {
glPopMatrix();
// Draw line to mouse
if (!dragging && GetHighlightedFeature() == -1) {
if (!dragging && curFeature == -1) {
SetLineColour(colour[0]);
DrawLine(dx,dy,video.x,video.y);
}