Thanks for swift reply, Uli

The function to draw is:
colors for bg and fg are taken from array

function sep(fg,bg)
   sp = wibox.widget.base.make_widget()
   sp.fit = function(mycross, width, height)
       local size = math.min(width, height)
       return size/2, size
   end
   sp.draw = function(sp, wibox, cr,width, height)
       r,g,b,a = hexadecimal_to_rgba_percent(fg)
       cr:move_to(width,0)
       cr:line_to(0, height)
       cr:line_to(width,height)
       cr:close_path()
       cr:set_line_width(0)
       cr:set_source_rgba(r,g,b,a)
       cr:fill()
       if string.match(bg,"#%w+")
           then
            r,g,b,a = hexadecimal_to_rgba_percent(bg)
            cr:move_to(0,0)
            cr:line_to(width,0)
            cr:line_to(0,height)
            cr:close_path()
            cr:set_line_width(3)
            cr:set_source_rgba(r,g,b,a)
            cr:fill()
          else
            r,g,b,a = hexadecimal_to_rgba_percent(fg)
            cr:move_to(0,0)
            cr:line_to(width,0)
            cr:line_to(0,height)
            cr:close_path()
            cr:set_line_width(3)
            cr:set_source_rgba(r,g,b,a)
            cr:fill()
       end

   end
       return sp
end


Best regards, Andrey
--------------------------------------------------------------------------------------------------------------------
Andrey V. Golovin
Ph.D, Assistant professor,  Faculty of Bioengineering and Bioinformatics,
Lomonosov Moscow State University, 119991 Moscow, Russia.
tel: +7 (495) 939-5305 ; fax: +7 (495) 939-3181; mobile: +7(926)729-1579
E-mail: [email protected]
web: http://vsb.fbb.msu.ru <http://vsb.cmm.msu.ru>
--------------------------------------------------------------------------------------------------------------------


On Fri, Oct 11, 2013 at 2:40 PM, Andrey V Golovin <[email protected]
> wrote:

> Hi all
> I made simple cairo drawing in widget area.
> http://imgur.com/pIGDMXP.png
>
> But, these one pixel lines between drawings looks bad. I played with cairo
> colors it does not help. Is somebody has an idea how to fix it would be
> very nice to share.
> Thanks in advance.
>
> Best regards, Andrey
>
>

Reply via email to