Action Item #569
|Status:||In Progress||Start date:||09 Mar 2017|
|Target version:||PiBox - 0.12.0|
|Severity:||02 - High|
Now that I know more about scaling in Cairo I can do some needed updates to PiClock.
- Switch to gdk_pixbuf to load the image, thereby supporting more file types
- Use libpibox to get screen dimensions
- Scale the images to fit the window using gdk_pixbuf scaling function (see launcher)
- Look at this code to see how to create a shadow from an image. This can be used to draw shadows under the hands, though getting the light direction correct could be difficult.
The scaling will make the clock fit on any display.
- Status changed from New to In Progress
- % Done changed from 0 to 10
- Compute scaled percentage of face to fit it's drawing area the first time it is used.
- Use percentage to scale hands and overlay the first time they are used.
- Scale only once, then set flag to say scaling has been done.
- Gen the cairo surface after the scaling has been done and save it.
Scaling should be done on the gdk_pixbuf and then the new pixbuf replaces the old one. The pixbuf is then used as a source for a cairo surface.
This will require moving the bottom half of loadtheme into the widget code, which is really where it belongs anyway.