示例#1
0
 void DrawTagBlocks(Cairo.Context cr)
 {
     cr.SelectTagOverlayFont();
     this.tagBlockSiteColumn.Draw(cr);
     foreach (var column in this.tagBlockColumns)
     {
         column.Draw(cr);
     }
 }
示例#2
0
        void UpdateTagBlocks(Cairo.Context cr, Image image, double offsetY, double paddingBottom)
        {
            this.tagBlockColumns.Clear();
            this.tagBlockSiteColumn.Clear();

            if (image == null)
            {
                return;
            }

            cr.SelectTagOverlayFont();

            var column = new TagBlockColumn(8.0);

            foreach (string tag in image.Tags)
            {
                var tagBlock = new TagBlock(cr, tag);

                tagBlock.Position.Y = offsetY;

                if (tagBlock.IsSiteTag)
                {
                    this.tagBlockSiteColumn.AddTagBlock(tagBlock);
                }
                else
                {
                    if (tagBlock.Height + column.Height + offsetY > this.canvasSize.Y - paddingBottom)
                    {
                        if (column.Count == 0)
                        {
                            // height is too small to fit even a single item
                            break;
                        }
                        this.tagBlockColumns.Add(column);
                        column = new TagBlockColumn(column.OffsetX + column.Width);
                    }
                    column.AddTagBlock(tagBlock);
                }
            }
            if (column.Count > 0)
            {
                this.tagBlockColumns.Add(column);
            }

            this.tagBlockSiteColumn.Move(this.canvasSize.X - 8);
        }
示例#3
0
 void DrawInfoString(Cairo.Context cr, Image image)
 {
     cr.SelectTagOverlayFont();
     cr.DrawStringAt(8, 8 + cr.FontExtents.Height, this.infoString, COLOR_BLACK, COLOR_IMAGE_INFO);
 }