Changeset d63623f in mainline for uspace/lib/ui/src/paint.c
- Timestamp:
- 2021-07-16T17:45:12Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4afb6c9
- Parents:
- 61bf9dd9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/paint.c
r61bf9dd9 rd63623f 49 49 * @param thickness Bevel thickness in pixels 50 50 * @param inside Place to store rectangle of the interior or @c NULL 51 * @re utrn EOK on success or an error code51 * @return EOK on success or an error code 52 52 */ 53 53 errno_t ui_paint_bevel(gfx_context_t *gc, gfx_rect_t *rect, … … 107 107 } 108 108 109 if (inside != NULL) { 110 inside->p0.x = rect->p0.x + thickness; 111 inside->p0.y = rect->p0.y + thickness; 112 inside->p1.x = rect->p1.x - thickness; 113 inside->p1.y = rect->p1.y - thickness; 114 } 109 if (inside != NULL) 110 ui_paint_get_bevel_inside(gc, rect, thickness, inside); 115 111 116 112 return EOK; 117 113 error: 118 114 return rc; 115 } 116 117 /** Get bevel interior rectangle. 118 * 119 * Get the bevel interior rectangle without painting it. 120 * 121 * @param gc Graphic context 122 * @param rect Rectangle to paint into 123 * @param thickness Bevel thickness in pixels 124 * @param inside Place to store rectangle of the interior 125 */ 126 void ui_paint_get_bevel_inside(gfx_context_t *gc, gfx_rect_t *rect, 127 gfx_coord_t thickness, gfx_rect_t *inside) 128 { 129 inside->p0.x = rect->p0.x + thickness; 130 inside->p0.y = rect->p0.y + thickness; 131 inside->p1.x = rect->p1.x - thickness; 132 inside->p1.y = rect->p1.y - thickness; 119 133 } 120 134 … … 147 161 error: 148 162 return rc; 163 } 164 165 /** Get inset frame interior rectangle. 166 * 167 * This allows one to get the interior rectangle without actually painting 168 * the inset frame. 169 * 170 * @param resource UI resource 171 * @param rect Rectangle to paint onto 172 * @param inside Place to store inside rectangle or @c NULL 173 */ 174 void ui_paint_get_inset_frame_inside(ui_resource_t *resource, gfx_rect_t *rect, 175 gfx_rect_t *inside) 176 { 177 ui_paint_get_bevel_inside(resource->gc, rect, 2, inside); 149 178 } 150 179
Note:
See TracChangeset
for help on using the changeset viewer.