~ubuntu-branches/ubuntu/oneiric/cairo-dock/oneiric-201106091216

« back to all changes in this revision

Viewing changes to src/gldit/cairo-dock-draw.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2010-10-06 19:23:03 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20101006192303-o9k0z64l9mx5irip
Tags: 2.2.0~4-0ubuntu1
* New Upstream Version (LP: #653702)
* Fixed a few bugs:
 - Fixed a random crash if CD is launched much time before the WM
 - Improved the OpenGL backend.
 - Some Images paths were wrong
 - Icon label text was truncated (LP: #611738)
 - Fixed a bug when the font was too big
 - Gauges: Add a line return in order to read all Readme file
 - Dialogues don't respect selected font (LP: #518628)
* data/help.conf.in:
 - Removed the Gnome-Panel: Used the right gconf key

Show diffs side-by-side

added added

removed removed

Lines of Context:
571
571
                else
572
572
                        cairo_translate (pCairoContext, floor (icon->fDrawY), floor (icon->fDrawX + icon->fGlideOffset * icon->fWidth * icon->fScale * (icon->fGlideOffset < 0 ? fGlideScale : 1)));
573
573
                
574
 
                double fOffsetX = (/**icon->fWidthFactor * */icon->fWidth * icon->fScale - icon->iTextWidth) / 2;
575
 
                if (fOffsetX < - icon->fDrawX)
 
574
                double fOffsetX = (icon->fWidth * icon->fScale - icon->iTextWidth) / 2;
 
575
                if (fOffsetX < - icon->fDrawX)  // l'etiquette deborde a gauche.
576
576
                        fOffsetX = - icon->fDrawX;
577
 
                else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth)
 
577
                else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth)  // l'etiquette deborde a droite.
578
578
                        fOffsetX = iWidth - icon->iTextWidth - icon->fDrawX;
579
579
                
580
580
                if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)
581
581
                        cairo_rotate (pCairoContext, icon->fOrientation);
582
582
                
583
 
                if (! bIsHorizontal && myLabels.bTextAlwaysHorizontal)
 
583
                if (bIsHorizontal)
 
584
                {
 
585
                        cairo_set_source_surface (pCairoContext,
 
586
                                icon->pTextBuffer,
 
587
                                floor (fOffsetX),
 
588
                                floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale));
 
589
                }
 
590
                else if (myLabels.bTextAlwaysHorizontal)
584
591
                {
585
592
                        if (fOffsetX < - icon->fDrawY)
586
593
                                fOffsetX = - icon->fDrawY;
587
594
                        cairo_set_source_surface (pCairoContext,
588
595
                                icon->pTextBuffer,
589
 
                                /**floor ((pDock->container.bDirectionUp ? -myLabels.iLabelSize : - (pDock->container.bUseReflect ? myIcons.fReflectSize : 0.)) - myLabels.iconTextDescription.iMargin + 1),*/
590
596
                                floor (fOffsetX),
591
597
                                0.);
592
598
                }
593
 
                else if (bIsHorizontal)
594
 
                        cairo_set_source_surface (pCairoContext,
595
 
                                icon->pTextBuffer,
596
 
                                floor (fOffsetX),
597
 
                                floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/));
598
599
                else
599
600
                {
600
 
                        cairo_translate (pCairoContext, icon->iTextWidth/2, icon->iTextHeight/2);
601
601
                        cairo_rotate (pCairoContext, bDirectionUp ? - G_PI/2 : G_PI/2);
602
 
                        cairo_translate (pCairoContext, -icon->iTextWidth/2, -icon->iTextHeight/2);
603
602
                        cairo_set_source_surface (pCairoContext,
604
603
                                icon->pTextBuffer,
605
 
                                floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/),
606
 
                                floor (fOffsetX));
 
604
                                floor (bDirectionUp ? fOffsetX - icon->fWidth * icon->fScale : fOffsetX),
 
605
                                -floor (bDirectionUp ? myLabels.iLabelSize : icon->fHeight * icon->fScale + myLabels.iLabelSize));
607
606
                }
608
607
                double fMagnitude;
609
608
                if (myLabels.bLabelForPointedIconOnly || pDock->fMagnitudeMax == 0.)