Skip to content

Commit

Permalink
Removing float m_drawingVerticalUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Jan 7, 2015
1 parent 5a353a0 commit 6af9898
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 21 deletions.
4 changes: 0 additions & 4 deletions include/vrv/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ class Doc: public Object
int m_drawingBrevisWidth[2];
/** Accident width for normal and small staff and normal and grace size */
int m_drawingAccidWidth[2][2];
/** A vertical unit corresponding to the 1/4 of an interline */
float m_drawingVerticalUnit1[2];
/** A vertical unit corresponding to the 1/8 of an interline */
float m_drawingVerticalUnit2[2];
/** Current music font for normal and small staff and normal and grace size */
FontMetricsInfo m_drawingFonts[2][2];
/** music font */
Expand Down
5 changes: 0 additions & 5 deletions src/doc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,6 @@ Page *Doc::SetDrawingPage( int pageIdx )
m_drawingLyricFonts[0].SetPointSize( m_drawingLyricFont.GetPointSize() );
m_drawingLyricFonts[1].SetPointSize( m_drawingLyricFont.GetPointSize() );

m_drawingVerticalUnit1[0] = (float)m_drawingInterl[0]/4;
m_drawingVerticalUnit2[0] = (float)m_drawingInterl[0]/8;
m_drawingVerticalUnit1[1] = (float)m_drawingInterl[1]/4;
m_drawingVerticalUnit2[1] = (float)m_drawingInterl[1]/8;

float glyph_size;
Glyph *glyph;
int x, y, w, h;
Expand Down
8 changes: 4 additions & 4 deletions src/view_beam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,25 +477,25 @@ if (fPente)
if (fb.fl_cond) /* esth: eviter que queues depassent barres */
{ if (crd[i].prov) /* venant du haut, m_stemDir en bas */
{ /***fy1 = *(_ybeam+i)+v_pnt;***/ /* on raccourcit m_stemDir */
fy2 = crd[i].b-m_doc->m_drawingVerticalUnit2[staff->staffSize];
fy2 = crd[i].b-m_doc->m_drawingHalfInterl[staff->staffSize]/4;
}
else
{ /***fy1 = *(_ybeam+i)-e_t->v_pnt;***/ /* on allonge m_stemDir */
fy2 = crd[i].b+m_doc->m_drawingVerticalUnit2[staff->staffSize];
fy2 = crd[i].b+m_doc->m_drawingHalfInterl[staff->staffSize]/4;
}
}
else // on tient compte de l'‚paisseur qui fait des "bosses"
{ if (fb.dir == STEMDIRECTION_up) // m_stemDir en haut
{ fy1 = *(_ybeam+i) - m_doc->m_env.m_stemWidth;
fy2 = crd[i].b+m_doc->m_drawingVerticalUnit2[staff->staffSize];
fy2 = crd[i].b+m_doc->m_drawingHalfInterl[staff->staffSize]/4;
crd[i].chk->m_drawingStemStart.x = crd[i].chk->m_drawingStemEnd.x = crd[i].a;
crd[i].chk->m_drawingStemStart.y = fy2;
crd[i].chk->m_drawingStemEnd.y = fy1;
crd[i].chk->m_drawingStemDir = true;
}
else
{ fy1 = *(_ybeam+i) + m_doc->m_env.m_stemWidth;
fy2 = crd[i].b-m_doc->m_drawingVerticalUnit2[staff->staffSize];
fy2 = crd[i].b-m_doc->m_drawingHalfInterl[staff->staffSize]/4;
crd[i].chk->m_drawingStemStart.x = crd[i].chk->m_drawingStemEnd.x = crd[i].a;
crd[i].chk->m_drawingStemStart.y = fy2;
crd[i].chk->m_drawingStemEnd.y = fy1;
Expand Down
14 changes: 7 additions & 7 deletions src/view_element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St
if (staff->notAnc)
DrawVerticalLine ( dc,y2,(int)(ynn + m_doc->m_drawingHalfInterl[staffSize]),x2, m_doc->m_env.m_stemWidth );//queue en descendant
else
DrawVerticalLine ( dc,y2,(int)(ynn+ m_doc->m_drawingVerticalUnit2[staffSize]),x2 - (m_doc->m_env.m_stemWidth / 2), m_doc->m_env.m_stemWidth );//queue en descendant
DrawVerticalLine ( dc,y2,(int)(ynn+ m_doc->m_drawingHalfInterl[staffSize]/4),x2 - (m_doc->m_env.m_stemWidth / 2), m_doc->m_env.m_stemWidth );//queue en descendant

element->m_drawingStemStart.x = element->m_drawingStemEnd.x = x2 - (m_doc->m_env.m_stemWidth / 2);
element->m_drawingStemEnd.y = y2;
element->m_drawingStemStart.y = (int)(ynn+ m_doc->m_drawingVerticalUnit2[staffSize]);
element->m_drawingStemStart.y = (int)(ynn+ m_doc->m_drawingHalfInterl[staffSize]/4);
element->m_drawingStemDir = true;

if (formval > DUR_4)
Expand All @@ -423,10 +423,10 @@ void View::DrawNote ( DeviceContext *dc, LayerElement *element, Layer *layer, St
if (staff->notAnc)
DrawVerticalLine ( dc,y2,ynn- m_doc->m_drawingHalfInterl[staffSize],x2 - (m_doc->m_env.m_stemWidth / 2), m_doc->m_env.m_stemWidth );//queue en descendant
else
DrawVerticalLine ( dc,y2,(int)(ynn- m_doc->m_drawingVerticalUnit2[staffSize]),x2 - (m_doc->m_env.m_stemWidth / 2), m_doc->m_env.m_stemWidth ); // queue en montant
DrawVerticalLine ( dc,y2,(int)(ynn- m_doc->m_drawingHalfInterl[staffSize]/4),x2 - (m_doc->m_env.m_stemWidth / 2), m_doc->m_env.m_stemWidth ); // queue en montant

element->m_drawingStemStart.x = element->m_drawingStemEnd.x = x2 - (m_doc->m_env.m_stemWidth / 2);
element->m_drawingStemStart.y = (int)(ynn- m_doc->m_drawingVerticalUnit2[staffSize]);
element->m_drawingStemStart.y = (int)(ynn- m_doc->m_drawingHalfInterl[staffSize]/4);
element->m_drawingStemEnd.y = y2;
element->m_drawingStemDir = false;

Expand Down Expand Up @@ -943,8 +943,8 @@ void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer
x1 = xn - m_doc->m_drawingBrevisWidth[staff->staffSize]; x2 = xn + m_doc->m_drawingBrevisWidth[staff->staffSize];
y1 = y + m_doc->m_drawingHalfInterl[staff->staffSize];
y2 = y - m_doc->m_drawingHalfInterl[staff->staffSize];
y3 = (int)(y1 + m_doc->m_drawingVerticalUnit1[staff->staffSize]); // partie d'encadrement qui depasse
y4 = (int)(y2 - m_doc->m_drawingVerticalUnit1[staff->staffSize]);
y3 = (int)(y1 + m_doc->m_drawingHalfInterl[staff->staffSize]/2); // partie d'encadrement qui depasse
y4 = (int)(y2 - m_doc->m_drawingHalfInterl[staff->staffSize]/2);


//if (!note->m_ligObliqua && (!View::s_drawingLigObliqua)) // notes rectangulaires, y c. en ligature
Expand Down Expand Up @@ -1445,7 +1445,7 @@ void View::DrawCustos( DeviceContext *dc, LayerElement *element, Layer *layer, S
int x = element->GetDrawingX();
int y = element->GetDrawingY();

y -= m_doc->m_drawingHalfInterl[staff->staffSize] - m_doc->m_drawingVerticalUnit2[staff->staffSize]; // LP - correction in 2.0.0
y -= m_doc->m_drawingHalfInterl[staff->staffSize] - m_doc->m_drawingHalfInterl[staff->staffSize]/4; // LP - correction in 2.0.0

// HARDCODED (smufl code wrong)
DrawSmuflCode( dc, x, y, 35, staff->staffSize, custos->m_cueSize );
Expand Down
2 changes: 1 addition & 1 deletion src/view_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ int View::CalculatePitchCode ( Layer *layer, int y_n, int x_pos, int *octave )
Staff *parentStaff = dynamic_cast<Staff*>(layer->m_parent);
int staffSize = parentStaff->staffSize;
// calculer position du do central en fonction clef
y_n += (int) m_doc->m_drawingVerticalUnit2[staffSize];
y_n += (int) m_doc->m_drawingHalfInterl[staffSize]/4;
yb = parentStaff->GetDrawingY() - m_doc->m_drawingStaffSize[staffSize]*2; // UT1 default


Expand Down

0 comments on commit 6af9898

Please sign in to comment.