bool IGraphics::DrawRect(const IColor* pColor, IRECT* pR) { bool rc = DrawHorizontalLine(pColor, pR->T, pR->L, pR->R); rc &= DrawHorizontalLine(pColor, pR->B, pR->L, pR->R); rc &= DrawVerticalLine(pColor, pR->L, pR->T, pR->B); rc &= DrawVerticalLine(pColor, pR->R, pR->T, pR->B); return rc; }
void FillTexture( LockedTexture& texture ) { const SFloatRGBAColor base_color = m_BaseColor; const SFloatRGBAColor line_color = m_LineColor; // Fill the texture with the base color texture.Clear( base_color ); const int w = texture.GetWidth(); const int h = texture.GetHeight(); const int num_rows = m_NumRows; const int num_columns = m_NumColumns; const unsigned int row_height = h / num_rows; const unsigned int column_width = w / num_columns; const int line_width = m_LineWidth; const int line_width_at_tex_border = m_DoubleLineWidthAtTextureBorders ? line_width * 2 : line_width; // Draw the horizontal lines for( int y=0; y<line_width_at_tex_border/2; y++ ) DrawHorizontalLine( y, texture ); for( int i=1; i<num_rows-1; i++ ) { for( int y=0; y<line_width; y++ ) DrawHorizontalLine( i * row_height - line_width/2 + y, texture ); } for( int y=0; y<line_width_at_tex_border/2; y++ ) DrawHorizontalLine( h - 1 - y, texture ); // Draw the vertical lines for( int x=0; x<line_width_at_tex_border/2; x++ ) DrawVerticalLine( x, texture ); for( int i=1; i<num_columns-1; i++ ) { for( int x=0; x<line_width; x++ ) DrawVerticalLine( i * column_width - line_width/2 + x, texture ); } for( int x=0; x<line_width_at_tex_border/2; x++ ) DrawVerticalLine( w - 1 - x, texture ); }
void wxStdRenderer::DrawFrameWithoutLabel(wxDC& dc, const wxRect& rectFrame, const wxRect& rectLabel) { // draw left, bottom and right lines entirely DrawVerticalLine(dc, rectFrame.GetLeft(), rectFrame.GetTop(), rectFrame.GetBottom() - 2); DrawHorizontalLine(dc, rectFrame.GetBottom() - 1, rectFrame.GetLeft(), rectFrame.GetRight()); DrawVerticalLine(dc, rectFrame.GetRight() - 1, rectFrame.GetTop(), rectFrame.GetBottom() - 1); // and 2 parts of the top line DrawHorizontalLine(dc, rectFrame.GetTop(), rectFrame.GetLeft() + 1, rectLabel.GetLeft()); DrawHorizontalLine(dc, rectFrame.GetTop(), rectLabel.GetRight(), rectFrame.GetRight() - 2); }
void Flicker_Cursor(void) { unsigned int temp ; static unsigned char flicker_status = 0x00 ; if((Active_Edit_Dig!=0xFF)) { temp = Edit_Dig[Active_Edit_Dig].x +Edit_Dig[Active_Edit_Dig].width/2 -strlen(Edit_Dig[Active_Edit_Dig].string)*6 ; temp += Active_Digit*13-1-4 ; // 计算光标横坐标 if(flicker_status++==0x00) DrawVerticalLine( temp,Edit_Dig[Active_Edit_Dig].y+Edit_Dig[Active_Edit_Dig].height/2-10,22,Color) ; // 绘制光标 else { DrawVerticalLine( temp,Edit_Dig[Active_Edit_Dig].y+Edit_Dig[Active_Edit_Dig].height/2-10,22,Color_BK) ; // 消隐光标 flicker_status = 0x00 ; } } }
void View::DrawMensurSlash(DeviceContext *dc, int a, int yy, Staff *staff) { assert(dc); assert(staff); int y1 = yy; int y2 = y1 - m_doc->GetDrawingStaffSize(staff->m_drawingStaffSize); DrawVerticalLine(dc, y1, y2, a, m_doc->GetDrawingStaffLineWidth(staff->m_drawingStaffSize)); return; }
bool IGraphics::DrawVerticalLine(const IColor* pColor, IRECT* pR, float x) { x = BOUNDED(x, 0.0f, 1.0f); int xi = pR->L + int(x * (float) (pR->R - pR->L)); return DrawVerticalLine(pColor, xi, pR->T, pR->B); }
//*************************************************************************************** // * // void ActiveEditDig(): 设置数字编辑控件活动状态 * // * //*************************************************************************************** void EditDigMessage(unsigned char Message,char * p) { unsigned char i,temp,k ; _DINT() ; Color = WINDOW_COLOR ; Color_BK = 0xFFFF ; temp = Edit_Dig[Active_Edit_Dig].x +Edit_Dig[Active_Edit_Dig].width/2 -strlen(Edit_Dig[Active_Edit_Dig].string)*6 ; temp += Active_Digit*13-1-4 ; // 计算光标位置 i = Active_Edit_Dig ; DrawVerticalLine( temp, Edit_Dig[Active_Edit_Dig].y +Edit_Dig[Active_Edit_Dig].height/2-10, 22,Color_BK ) ; // 消隐光标 if(Message==129) // 输入了中文字符 { if(strlen(Edit_Dig[i].string)+1<(Edit_Dig[i].property&EDIT_LIMIT)) { Edit_Dig[i].string[strlen(Edit_Dig[i].string)+2] = 0x00 ; // 插入字符 for(k=strlen(Edit_Dig[i].string)+1;k>Active_Digit;k--) Edit_Dig[i].string[k] = Edit_Dig[i].string[k-2] ; Edit_Dig[i].string[Active_Digit++] = *p ; Edit_Dig[i].string[Active_Digit++] = *(++p) ; RedrawEditDig(i) ; } } switch(Message) { case 128: RedrawEditDig(i) ; case 0xFF: break ; case Left: if(Active_Digit==0) Active_Digit = strlen(Edit_Dig[i].string) ; else Active_Digit-- ; if(Edit_Dig[i].string[Active_Digit]>128) Active_Digit-- ; break ; case Right: if(Active_Digit==strlen(Edit_Dig[i].string)) Active_Digit = 0 ; else Active_Digit++ ; if(Edit_Dig[i].string[Active_Digit-1]>128) Active_Digit++ ; break ; case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8: case 9:case 0: case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': if(strlen(Edit_Dig[i].string)<(Edit_Dig[i].property&EDIT_LIMIT)) { Edit_Dig[i].string[strlen(Edit_Dig[i].string)+1] = 0x00 ; // 插入字符 for(k=strlen(Edit_Dig[i].string);k>Active_Digit;k--) Edit_Dig[i].string[k] = Edit_Dig[i].string[k-1] ; if(Message<=9) Edit_Dig[i].string[Active_Digit] = Message+0x30 ; else Edit_Dig[i].string[Active_Digit] = Message ; Active_Digit++ ; RedrawEditDig(i) ; } break ; case Delete: if(strlen(Edit_Dig[i].string)>0) { temp = strlen(Edit_Dig[i].string) ; if(Edit_Dig[i].string[Active_Digit]>128) for(k=Active_Digit;k<temp-1;k++) Edit_Dig[i].string[k] = Edit_Dig[i].string[k+2] ; // 删除下一中文字符 else for(k=Active_Digit;k<temp;k++) Edit_Dig[i].string[k] = Edit_Dig[i].string[k+1] ; // 删除下一西文字符 RedrawEditDig(i) ; } break ; case Backspace: if(Active_Digit==0) break ; Active_Digit-- ; if(Edit_Dig[i].string[Active_Digit]>128) Active_Digit-- ; if(strlen(Edit_Dig[i].string)>0) { temp = strlen(Edit_Dig[i].string) ; if(Edit_Dig[i].string[Active_Digit]>128) for(k=Active_Digit;k<temp-1;k++) Edit_Dig[i].string[k] = Edit_Dig[i].string[k+2] ; // 删除下一中文字符 else for(k=Active_Digit;k<temp;k++) Edit_Dig[i].string[k] = Edit_Dig[i].string[k+1] ; // 删除下一字符 RedrawEditDig(i) ; } break ; default: break ; } Event |= SHOULD_FLICKER ; flicker_status = 0x00 ; _EINT() ; }
void View::DrawLigatureNote(DeviceContext *dc, LayerElement *element, Layer *layer, Staff *staff) { assert(dc); assert(element); assert(layer); assert(staff); LogDebug("DrawLigatureNote"); Note *note = dynamic_cast<Note *>(element); assert(note); int xn, x1, x2, y, y1, y2, y3, y4; // int yy2, y5; // unused int verticalCenter, up, epaisseur; epaisseur = std::max(2, m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2); xn = element->GetDrawingX(); y = 99; // LogDebug("DrawLigatureNote: _ligObliqua=%d drawingX=%d y=%d", note->m_ligObliqua, xn, y); LogDebug("DrawLigatureNote: drawingX=%d y=%d", xn, y); /* if ((note->m_lig==LIG_MEDIAL) || (note->m_lig==LIG_TERMINAL)) { CalculateLigaturePosX(element, layer, staff); } else */ { xn = element->GetDrawingX(); } // Compute the dimensions of the rectangle x1 = xn - m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); x2 = xn + m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2); // part of the frame that overflows y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2); // if (!note->m_ligObliqua && (!View::s_drawingLigObliqua)) // rectangular notes, incl. ligature { if (note->GetColored() != BOOLEAN_true) { // double the bases of rectangles DrawObliquePolygon(dc, x1, y1, x2, y1, -epaisseur); DrawObliquePolygon(dc, x1, y2, x2, y2, epaisseur); } else DrawFilledRectangle(dc, x1, y1, x2, y2); // // ENZ correction of x2 DrawVerticalLine(dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); // lateral brace DrawVerticalLine(dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } /* else // handle obliques { if (!View::s_drawingLigObliqua) // 1st pass: Initial flagStemHeight { DrawVerticalLine (dc,y3,y4,x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); View::s_drawingLigObliqua = true; //oblique = false; // if (val == DUR_1) // left tail up if DUR_1 // queue_lig = true; } else // 2nd pass: oblique lines and final flagStemHeighte { x1 -= m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize] * 2; // auto advance y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); // ligat_y contains original y yy2 = y2; y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // go up a INTERL if (note->GetColored()==BOOLEAN_true) DrawObliquePolygon (dc, x1, y1, x2, yy2, m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)); else { DrawObliquePolygon (dc, x1, y1, x2, yy2, 5); DrawObliquePolygon (dc, x1, y5, x2, y2, -5); } DrawVerticalLine (dc,y3,y4,x2,m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); // enclosure flagStemHeighte View::s_drawingLigObliqua = false; // queue_lig = false; // ??defuses alg.queue DUR_BR?? } } if (note->m_lig) // remember positions from one note to another; connect notes by bars { *(View::s_drawingLigX+1) = x2; *(View::s_drawingLigY+1) = y; // connect ligature beamed notes by bar flagStemHeightes //if (in(x1,(*View::s_drawingLigX)-2,(*View::s_drawingLigX)+2) || (this->fligat && this->lat && !Note1::marq_obl)) // the latest conditions to allow previous ligature flagStemHeighte // DrawVerticalLine (dc, *ligat_y, y1, (this->fligat && this->lat) ? x2: x1, m_doc->m_parameters.m_stemWidth); // ax2 - drawing flagStemHeight lines missing *View::s_drawingLigX = *(View::s_drawingLigX + 1); *View::s_drawingLigY = *(View::s_drawingLigY + 1); } y3 = y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; if (note->m_lig) { if (note->m_dur == DUR_BR) // && this->queue_lig) // tail left bottom: initial downward DUR_BR // ax2 - no support for queue_lig (see WG corrigeLigature) { DrawVerticalLine (dc, y2, y3, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } else if (note->m_dur == DUR_LG) // && !this->queue_lig) // DUR_LG ligature, tail right down // ax2 - no support for queue_lig { DrawVerticalLine (dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } else if (note->m_dur == DUR_1) // && this->queue_lig) // queue gauche haut // ax2 - no support for queue_lig { y2 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; DrawVerticalLine (dc, y1, y2, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } } else if (note->m_dur == DUR_LG) // isolated DUR_LG: tail like normal notes */ if (note->GetActualDur() == DUR_LG) { verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; // ENZ up = (y < verticalCenter) ? true : false; // ENZ if (note->GetDrawingStemDir() != STEMDIRECTION_NONE) { if (note->GetDrawingStemDir() == STEMDIRECTION_up) { up = true; } else { up = false; } } if (!up) { y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 8; y2 = y1; } else { y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 6; y2 = y1; } DrawVerticalLine(dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } return; }
void View::DrawMaximaToBrevis(DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff) { assert(dc); assert(element); assert(layer); assert(staff); Note *note = dynamic_cast<Note *>(element); assert(note); int xn, xLeft, xRight, yTop, yBottom, y3, y4; // int yy2, y5; // unused int verticalCenter, up, height; bool mensural_black = (staff->m_drawingNotationType == NOTATIONTYPE_mensural_black); bool fillNotehead = (mensural_black || note->GetColored()) && !(mensural_black && note->GetColored()); height = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2; xn = element->GetDrawingX(); // Calculate size of the rectangle xLeft = xn - m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); xRight = xn + m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); if (note->GetActualDur() == DUR_MX) { // Maxima is twice the width of brevis xLeft -= m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); xRight += m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); } yTop = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); yBottom = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y3 = yTop; y4 = yBottom; if (!mensural_black) { y3 += (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; // partie d'encadrement qui depasse y4 -= (int)m_doc->GetDrawingUnit(staff->m_drawingStaffSize) / 2; } if (!fillNotehead) { // double the bases of rectangles DrawObliquePolygon(dc, xLeft, yTop, xRight, yTop, -height); DrawObliquePolygon(dc, xLeft, yBottom, xRight, yBottom, height); } else { DrawFilledRectangle(dc, xLeft, yTop, xRight, yBottom); } DrawVerticalLine(dc, y3, y4, xLeft, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); // corset lateral DrawVerticalLine(dc, y3, y4, xRight, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); // stem if (note->GetActualDur() < DUR_BR) { verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize) * 2; up = (y < verticalCenter) ? true : false; if (note->GetDrawingStemDir() != STEMDIRECTION_NONE) { if (note->GetDrawingStemDir() == STEMDIRECTION_up) { up = true; } else { up = false; } } if (!up) { y3 = yTop - m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 8; yBottom = yTop; } else { y3 = yTop + m_doc->GetDrawingUnit(staff->m_drawingStaffSize) * 6; yBottom = yTop; } DrawVerticalLine(dc, yBottom, y3, xRight, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); } return; }
void View::DrawLigature ( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ) { assert( dc ); assert( element ); assert( layer ); assert( staff ); Note *note = dynamic_cast<Note*>(element); assert( note ); int xn, x1, x2, y1, y2, y3, y4; // int yy2, y5; // unused int verticalCenter, up, epaisseur; epaisseur = std::max (2, m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2); xn = element->GetDrawingX(); /* if ((note->m_lig==LIG_MEDIAL) || (note->m_lig==LIG_TERMINAL)) { CalculateLigaturePosX ( element, layer, staff ); } else */{ xn = element->GetDrawingX(); } // calcul des dimensions du rectangle x1 = xn - m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); x2 = xn + m_doc->GetDrawingBrevisWidth(staff->m_drawingStaffSize); y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); // partie d'encadrement qui depasse y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); //if (!note->m_ligObliqua && (!View::s_drawingLigObliqua)) // notes rectangulaires, y c. en ligature { if (note->GetColored()!=BOOLEAN_true) { // double base des carrees DrawObliquePolygon ( dc, x1, y1, x2, y1, -epaisseur ); DrawObliquePolygon ( dc, x1, y2, x2, y2, epaisseur ); } else DrawFullRectangle( dc,x1,y1,x2,y2); // dessine val carree pleine // ENZ correction de x2 DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // corset lateral DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } /* else // traitement des obliques { if (!View::s_drawingLigObliqua) // 1e passage: ligne flagStemHeighte initiale { DrawVerticalLine (dc,y3,y4,x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); View::s_drawingLigObliqua = true; //oblique = OFF; // if (val == DUR_1) // queue gauche haut si DUR_1 // queue_lig = ON; } else // 2e passage: lignes obl. et flagStemHeighte finale { x1 -= m_doc->m_drawingBrevisWidth[staff->m_drawingStaffSize]*2; // avance auto y1 = *View::s_drawingLigY - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); // ligat_y contient y original yy2 = y2; y5 = y1+ m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); y2 += m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize); // on monte d'un INTERL if (note->GetColored()==BOOLEAN_true) DrawObliquePolygon ( dc, x1, y1, x2, yy2, m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)); else { DrawObliquePolygon ( dc, x1, y1, x2, yy2, 5); DrawObliquePolygon ( dc, x1, y5, x2, y2, -5); } DrawVerticalLine ( dc,y3,y4,x2,m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize)); //cloture flagStemHeighte View::s_drawingLigObliqua = false; // queue_lig = OFF; //desamorce alg.queue DUR_BR } } if (note->m_lig) // memoriser positions d'une note a l'autre; relier notes par barres { *(View::s_drawingLigX+1) = x2; *(View::s_drawingLigY+1) = y; // relie notes ligaturees par barres flagStemHeightes //if (in(x1,(*View::s_drawingLigX)-2,(*View::s_drawingLigX)+2) || (this->fligat && this->lat && !Note1::marq_obl)) // les dernieres conditions pour permettre ligature flagStemHeighte ancienne // DrawVerticalLine (dc, *ligat_y, y1, (this->fligat && this->lat) ? x2: x1, m_doc->m_parameters.m_stemWidth); // ax2 - drawing flagStemHeight lines missing *View::s_drawingLigX = *(View::s_drawingLigX + 1); *View::s_drawingLigY = *(View::s_drawingLigY + 1); } y3 = y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; if (note->m_lig) { if (note->m_dur == DUR_BR) // && this->queue_lig) // queue gauche bas: DUR_BR initiale descendante // ax2 - no support of queue_lig (see WG corrigeLigature) { DrawVerticalLine ( dc, y2, y3, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } else if (note->m_dur == DUR_LG) // && !this->queue_lig) // DUR_LG en ligature, queue droite bas // ax2 - no support of queue_lig { DrawVerticalLine (dc, y2, y3, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } else if (note->m_dur == DUR_1) // && this->queue_lig ) // queue gauche haut // ax2 - no support of queue_lig { y2 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; DrawVerticalLine ( dc, y1, y2, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } } else if (note->m_dur == DUR_LG) // DUR_LG isolee: queue comme notes normales */ if (note->GetActualDur() == DUR_LG) { verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; // ENZ up = (y < verticalCenter) ? ON : OFF; // ENZ if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) { if ( note->GetDrawingStemDir() == STEMDIRECTION_up) { up = ON; } else { up = OFF; } } if (!up) { y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8; y2 = y1; } else { y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; y2 = y1; } DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } return; }
void View::DrawMaximaToBrevis( DeviceContext *dc, int y, LayerElement *element, Layer *layer, Staff *staff ) { assert( dc ); assert( element ); assert( layer ); assert( staff ); Note *note = dynamic_cast<Note*>(element); assert( note ); int xn, x1, x2, y1, y2, y3, y4; // int yy2, y5; // unused int verticalCenter, up, height; height = m_doc->GetDrawingBeamWidth(staff->m_drawingStaffSize, false) / 2 ; xn = element->GetDrawingX(); // calcul des dimensions du rectangle x1 = xn - m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); x2 = xn + m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); if (note->GetActualDur() == DUR_MX) { x1 -= m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); x2 += m_doc->GetDrawingBrevisWidth( staff->m_drawingStaffSize ); } y1 = y + m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y2 = y - m_doc->GetDrawingUnit(staff->m_drawingStaffSize); y3 = (int)(y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); // partie d'encadrement qui depasse y4 = (int)(y2 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)/2); if (note->GetColored()!=BOOLEAN_true) { // double base des carrees DrawObliquePolygon ( dc, x1, y1, x2, y1, -height ); DrawObliquePolygon ( dc, x1, y2, x2, y2, height ); } else { DrawFullRectangle( dc,x1,y1,x2,y2); } DrawVerticalLine ( dc, y3, y4, x1, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // corset lateral DrawVerticalLine ( dc, y3, y4, x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); // stem if (note->GetActualDur() < DUR_BR) { verticalCenter = staff->GetDrawingY() - m_doc->GetDrawingDoubleUnit(staff->m_drawingStaffSize)*2; up = (y < verticalCenter) ? true : false; if ( note->GetDrawingStemDir() != STEMDIRECTION_NONE ) { if ( note->GetDrawingStemDir() == STEMDIRECTION_up) { up = true; } else { up = false; } } if (!up) { y3 = y1 - m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*8; y2 = y1; } else { y3 = y1 + m_doc->GetDrawingUnit(staff->m_drawingStaffSize)*6; y2 = y1; } DrawVerticalLine ( dc, y2,y3,x2, m_doc->GetDrawingStemWidth(staff->m_drawingStaffSize) ); } return; }