awesome

Welcome to awesome bug tracking system.
Tasklist

FS#997 - awful.widget.graph scroll direction

Attached to Project: awesome
Opened by dodo (dodo) - Monday, 14 May 2012, 16:46 GMT
Last edited by Uli Schlachter (psychon) - Wednesday, 13 June 2012, 19:54 GMT
Task Type Bug Report
Category Widgets
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version git/master
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

problem spotted here: http://article.gmane.org/gmane.comp.window-managers.awesome/8747


the first patch cleans up the draw behavior (since transparent colors are working again, the old behavior break when bg color has opacity).

the second patch adds the set_direction method to awful.widget.graph .
This task depends upon

Closed by  Uli Schlachter (psychon)
Wednesday, 13 June 2012, 19:54 GMT
Reason for closing:  Fixed
Comment by Uli Schlachter (psychon) - Monday, 14 May 2012, 16:57 GMT
For patch 1: What exactly do you mean with "is because to get rid of antialias"? According to xmag and a screenshot, my memory usage graph has more than two colors because there is antialiasing at the "edge" of the graph. So I guess that can't be the reason.
So what does this patch actually accomplish? (Yes, I do agree that painting the background first does make sense)

For patch 2: I'd propose breaking everyone's config again. :-)

If left-to-right is easier to implement than right-to-left (your patch looks a little like that), then let's just always force that direction. The other direction could be forced via a layout.
Currently there is wibox.layout.rotate, something similar could be done which mirrors a widget. This is likely a little more complicated to use in configs, but is definitely more generic.
What do you think about this idea?

Alternatively, if you don't like that approach (I'm not really convinced of it myself), why don't you implement the direction via cr:translate(width, 0) and cr:scale(-1, 0)? That way, the actual drawing code wouldn't have to worry about the direction. Sounds easier to me. (However, I'd like this to be implemented in such a way that the pattern (=foreground/background color) is not mirrored)

Oh and: If we can mirror a graph in right/left direction, why dont we also mirror it in top/bottom direction? (if you know what I mean)
Comment by dodo (dodo) - Monday, 14 May 2012, 22:57 GMT
for patch 1: i get blurred graphs when drawing with antialiasing.
but, does it makes sense to draw pixel perfect data with antialiasing?

for patch 2: *facepalm*

you're so right :)

how do you like the new patches?

i'm not sure if it's a good idea to name the method get_reflection (my other alternative is to add a lot of getters and setters :/ (this is thankfully not java :P))
Comment by Uli Schlachter (psychon) - Friday, 18 May 2012, 10:12 GMT
Patch 1 merged.

Patch 3: I'm still not sure why you want to get rid of the antialiasing in the graph. I kinda do like it.

Patch 2: Breaks without patch 3 (due to some missing "+0.5"s (or is it -0.5?) for the lines). At least I do think so, I haven't actually tested.
Comment by Uli Schlachter (psychon) - Friday, 18 May 2012, 10:14 GMT
> for patch 1: i get blurred graphs when drawing with antialiasing.
> but, does it makes sense to draw pixel perfect data with antialiasing?

Uhm, why pixel perfect? The current code doesn't do any rounding which would result in that.
Comment by dodo (dodo) - Wednesday, 06 June 2012, 05:18 GMT
ha! the missing -0.5 are the reason for the blurred graphs :D

alright .. here is the updated patch.

.. i guess you can skip the third patch :P
Comment by Uli Schlachter (psychon) - Wednesday, 13 June 2012, 15:24 GMT
That patch mirrors the graph horizontally (new values appear on the left side instead of right). Was that done on purpose?

Also, I just now wondered what happens when the involved colors have alpha components (see attached rc.lua patch). The old behavior is just wrong (stacked and non-stacked gives different results). Your patch makes this consistent and I guess drawing the background first and then the graph ontop of it matches the expected semantics, although the "old" approach might be a little more flexible... Dunno which one we want (but it really should be consistent between stacked and non-stacked)

Finally, sorry for me being awfully slow.
   patch (1.2 KiB)
Comment by Uli Schlachter (psychon) - Wednesday, 13 June 2012, 15:25 GMT
Scratch that, I just re-read the older messages in this issue. So yeah, obviously that was done on purpose, so was that color stuff.

Merged.
Comment by dodo (dodo) - Wednesday, 13 June 2012, 17:40 GMT
awesome! thank you for the fixes. :D

Loading...