@@ -354,39 +354,57 @@ void ParenCell::Draw(wxPoint point)
354
354
SetPen (1.0 );
355
355
356
356
int signWidth = m_signWidth - Scale_Px (2 );
357
-
358
- wxPoint pointList[ 5 ] ;
357
+
358
+ wxPointList points ;
359
359
// Left bracket
360
- pointList[0 ] = wxPoint (point.x + Scale_Px (1 ) + signWidth,
361
- point.y - m_center + Scale_Px (4 ));
362
- pointList[1 ] = wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
363
- point.y - m_center + signWidth / 2 + Scale_Px (4 ));
364
- pointList[2 ] = wxPoint (point.x + Scale_Px (1 ),
365
- point.y );
366
- pointList[3 ] = wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
367
- point.y + m_center - signWidth / 2 - Scale_Px (4 ));
368
- pointList[4 ] = wxPoint (point.x + Scale_Px (1 ) + signWidth,
369
- point.y + m_center - Scale_Px (4 ));
370
- configuration->GetAntialiassingDC ()->DrawSpline (5 ,pointList);
371
- pointList[2 ] = wxPoint (point.x + Scale_Px (1.5 ),
372
- point.y );
373
- adc->DrawSpline (5 ,pointList);
374
-
360
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth,
361
+ point.y - m_center + Scale_Px (4 )));
362
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
363
+ point.y - m_center + signWidth / 2 + Scale_Px (4 )));
364
+ points.Append (new wxPoint (point.x + Scale_Px (1 ),
365
+ point.y ));
366
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
367
+ point.y + m_center - signWidth / 2 - Scale_Px (4 )));
368
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth,
369
+ point.y + m_center - Scale_Px (4 )));
370
+ // Appending the last point twice should allow for an abrupt 180° turn
371
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth,
372
+ point.y + m_center - Scale_Px (4 )));
373
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
374
+ point.y + m_center - signWidth / 2 - Scale_Px (4 )));
375
+ // The middle point of the 2nd run of the parenthesis is at a different place
376
+ // making the parenthesis wider here
377
+ points.Append (new wxPoint (point.x + Scale_Px (2 ),
378
+ point.y ));
379
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth / 2 ,
380
+ point.y - m_center + signWidth / 2 + Scale_Px (4 )));
381
+ points.Append (new wxPoint (point.x + Scale_Px (1 ) + signWidth,
382
+ point.y - m_center + Scale_Px (4 )));
383
+ adc->DrawSpline (&points);
384
+
385
+ points.Clear ();
375
386
// Right bracket
376
- pointList[0 ] = wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
377
- point.y - m_center + Scale_Px (4 ));
378
- pointList[1 ] = wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
379
- point.y - m_center + signWidth / 2 + Scale_Px (4 ));
380
- pointList[2 ] = wxPoint (point.x + m_width - Scale_Px (1.5 ),
381
- point.y );
382
- pointList[3 ] = wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
383
- point.y + m_center - signWidth / 2 - Scale_Px (4 ));
384
- pointList[4 ] = wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
385
- point.y + m_center - Scale_Px (4 ));
386
- configuration->GetAntialiassingDC ()->DrawSpline (5 ,pointList);
387
- pointList[2 ] = wxPoint (point.x + m_width - Scale_Px (1 ),
388
- point.y );
389
- adc->DrawSpline (5 ,pointList);
387
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
388
+ point.y - m_center + Scale_Px (4 )));
389
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
390
+ point.y - m_center + signWidth / 2 + Scale_Px (4 )));
391
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1.5 ),
392
+ point.y ));
393
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
394
+ point.y + m_center - signWidth / 2 - Scale_Px (4 )));
395
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
396
+ point.y + m_center - Scale_Px (4 )));
397
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
398
+ point.y + m_center - Scale_Px (4 )));
399
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
400
+ point.y + m_center - signWidth / 2 - Scale_Px (4 )));
401
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (2 ),
402
+ point.y ));
403
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth / 2 ,
404
+ point.y - m_center + signWidth / 2 + Scale_Px (4 )));
405
+ points.Append (new wxPoint (point.x + m_width - Scale_Px (1 ) - signWidth,
406
+ point.y - m_center + Scale_Px (4 )));
407
+ adc->DrawSpline (&points);
390
408
}
391
409
break ;
392
410
}
0 commit comments