Timm Bäder
d2afa1d72a
gtkroundedbox: Remove some unneeded conditionals
...
Always pass exactly 4 GtkCssValue* parameters to apply_border_radius
and make sure they are properly const.
2017-10-02 14:34:47 +02:00
Benjamin Otte
4d9eedafcd
roundedbox: Add gtk_rounded_boxes_init_for_style()
...
Instead of making people intiialize a rectangle and then applying border
radius manually, provide a constructor that does it for them.
While doing that, also allow people to instead request the padding box
or the content box.
Refactor all relevant code to use this new constructor.
2016-12-20 18:01:12 +01:00
Benjamin Otte
95a2a5c54c
gtk: Remove GtkJunctionSides
2016-12-20 18:01:12 +01:00
Benjamin Otte
4fc64ae3dd
gsk: Add contains/intersect functions for GskRoundedRect
...
... and use them.
2016-12-20 18:01:12 +01:00
Benjamin Otte
a9809e5d30
gsk: Add gsk_rounded_rect_shrink()
...
... and replace _gtk_rounded_box_grow() and _gtk_rounded_box_shrink()
with it.
2016-12-20 18:01:11 +01:00
Benjamin Otte
f96f16899d
roundedbox: Remove _gtk_rounded_box_path()
...
Use gsk_rounded_rect_path() instead.
That's a private GSK function, be we can just include its header.
2016-12-20 18:01:10 +01:00
Benjamin Otte
fa9b0f9965
roundedbox: Remove _gtk_rounded_box_move()
...
Use gsk_rounded_rect_offset() instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
e26f84fca0
gtk: Remove GtkRoundedBox struct
...
Use GskRoundedRect instead.
2016-12-20 18:01:10 +01:00
Benjamin Otte
a2dfb1e93f
roundedbox: typedef to GskRoundedRect
2016-12-20 18:01:10 +01:00
Benjamin Otte
c04bece131
roundedbox: Use a graphene_size_t for the corners
...
Obviously, I'm trying to port GtkRoundedBox to GskRoundedRect.
This is the second step on that path.
2016-12-20 18:01:10 +01:00
Benjamin Otte
6d012fb4ea
gtk: Get rid of GtkCssCorner
...
We have GskCorner now which is identical.
2016-12-20 18:01:10 +01:00
Gustavo Noronha Silva
8e5e165f79
Fix off by one in check for GtkRoundedBox containing a rectangle
...
When checking if a rectangle is contained by the rounded box, the code
will refuse a rectangle which is the exact size as the one backing the
rounded box, since it checks for greater or equal width and height.
Check for greater only instead.
https://bugzilla.gnome.org/show_bug.cgi?id=774114
2016-11-21 10:53:11 -02:00
Timm Bäder
71b360cc8e
roundedbox: Initialize the hashtable key before using it
...
In mem_hash, we are iterating over the individual bytes of the key, so
make sure all of it is initialized.
2016-05-03 10:58:02 -04:00
Matthias Clasen
417eb0ad9c
Use a better hash for arcs
2016-04-30 22:39:58 -04:00
Matthias Clasen
52a34d32bb
Fix corner manipulation when growing rounded rects
...
This addresses problems with uneven border radius',
pointed out by Lapo.
2016-01-11 22:49:40 -05:00
Matthias Clasen
3f56c530b3
Be more careful with floating point divisions
...
The assumption that MIN() takes care of all infinities here
turns out to be wrong. We were getting inf and -nan for some
combinations of 0 width/height and corners, leading to invalid
matrices and cairo errors.
https://bugzilla.gnome.org/show_bug.cgi?id=759668
2016-01-08 13:17:58 -05:00
Matthias Clasen
d9f05aa3f9
rounded rect: cache arcs
...
We are only ever drawing axis-aligned quarter arcs here. By caching
these paths, sincos drops from the profiles for drawing-heavy
workloads.
2015-09-29 09:43:43 -04:00
Benjamin Otte
e2fc198b9e
roundedbox: Fix a copy/paste error
...
This caused shadows to not be drawn in certain situations when overlayed
via a popover animation.
https://bugzilla.gnome.org/show_bug.cgi?id=746862
2015-03-29 22:18:29 +02:00
Benjamin Otte
f1ec76a9c1
roundedbox: Treat path segments differently
...
If a side of the box is 0px wide, make the corners owned by the adjacent
sides. This avoids spilling over of unwanted colors from the 0-width
side into the corner.
This is the fix that should actually have been part of
7e5ac3a58d
but my amazing amending skills
got rid of it when amending the test.
2015-01-31 01:49:37 +01:00
Benjamin Otte
8d94140da9
roundedbox: Take a GtkCssStyle instead of a GtkStyleContext
...
This is in preparation for iusing GtkCssStyle instead of GtkStyleContext
in render functions.
2015-01-20 01:23:18 +01:00
Benjamin Otte
572f46067f
cssstyle: Rename GtkCssComputedValues => GtkCssStyle
...
This is literally just renaming of the object (and the associated source
files). No other changes are in there.
2015-01-07 14:26:46 +01:00
Matthias Clasen
73e6a05e38
Add clipping apis to GtkRoundedBox
...
This adds two functions for checking whether an axis-aligned
rectangle is completely outside or inside of a rounded box.
These are not trying to be exact, but fast.
2014-12-02 08:26:36 -05:00
Benjamin Otte
67456304d4
roundedbox: Only grow border-radius if there is one
...
This is relevant for shadow spread and goes in line with the web.
Testcase included.
2014-08-21 00:54:07 +02:00
Benjamin Otte
04bf3d1e1f
roundedbox: Remove functions that take a GtkThemingEngine
...
Instead, make the functions use a GtkStyleContext argument.
2014-08-16 19:39:44 +02:00
Cosimo Cecchi
489970bcdc
themingengine: use outlines to render focus rings
...
Instead of the old non-CSS implementation. This allows us to get rid of
the very last piece of custom theming in Adwaita.
2014-05-01 18:14:49 +02:00
Benjamin Otte
308971cc2e
roundedbox: Fix copy-paste error
...
y coordinates don't care about the right value, they want bottom.
2012-12-21 19:47:40 +01:00
Kalev Lember
907447c72d
gtkroundedbox: Fix a compiler warning
...
Use the correct enum type.
2012-12-02 19:47:54 +01:00
Benjamin Otte
dd99577691
gtk: Put private functions in headers and include those
...
This is part of a bunch of fixes for gcc complaining about
-Wmissing-declarations.
It puts functions into headers and includes those headers both where the
functions are defined and where they function are used.
2012-10-02 19:32:52 +02:00
Benjamin Otte
edbc8e4f57
cssvalue: Add a value for border-radius corner properties
...
... and convert those properties to this value.
2012-04-17 08:59:18 +02:00
Javier Jardón
9d0febc9a6
Change FSF Address
2012-02-27 17:06:11 +00:00
Cosimo Cecchi
ae132c0a1a
roundedbox: add _apply_border_radius() variations for engine/context
...
And make the base function just use the raw corner radii struct.
2012-02-14 16:36:56 -05:00
Benjamin Otte
a63ff72406
css: Convert border-radius to GtkCssNumber
...
We can do % now, wohoo!
2012-02-02 03:14:00 +01:00
Benjamin Otte
0c483cab0c
roundedbox: close path
...
Just because we do it everywhere else, too.
2012-01-09 18:38:00 +01:00
Benjamin Otte
1b9e15485e
themingengine: Implement 'dotted' and 'dashed'
2012-01-09 18:38:00 +01:00
Benjamin Otte
34a62d779b
css: Introduce a corner order enum
...
Same order as CSS again.
The nice thing about this is that now edge i in a rounded box follows
corner i and is followed by corner (i + 1) % 4.
2012-01-09 18:38:00 +01:00
Benjamin Otte
fdb3abefc3
roundedbox: Use GtkCssBorderCornerRadius type
...
GtkCssBorderRadius is going away.
2012-01-09 18:37:54 +01:00
Andrea Cimitan
b3f03d092f
roundedbox: Clamp border radius to box size
...
Note that clamping in rounded_box_grow() is not necessary as that
function cannot lead to overlap unless the rounded box was overlapping
previously.
https://bugzilla.gnome.org/show_bug.cgi?id=655009
2011-07-21 02:43:54 +02:00
Benjamin Otte
407b3f2cde
themingengine: Implement support for multiple border colors
...
Also use this support to implement inset and outset border styles
without cheats.
2011-06-13 15:01:52 +02:00
Benjamin Otte
e0b1943c97
roundedbox: Fix border radius grow algorithm
...
When one radius gets to 0, the other should be set to 0, too. Otherwise
the paths constructed from it will not be correct.
2011-06-13 15:01:52 +02:00
Benjamin Otte
deed7175ca
roundedbox: Handle shrinking to zero
...
We need it for wide separators.
2011-06-12 03:42:29 +02:00
Benjamin Otte
86719e1d35
gtk: Add GtkRoundedBox
...
CSS drawing operates on rounded boxes a lot, so it makes sense to split
them out instead of duplicating them everywhere.
2011-06-11 09:29:42 +02:00