Commit Graph

25 Commits

Author SHA1 Message Date
Martín Capello 51c976f167 Add GraphicsContext format hint member
This helps in setting the right paint color when using GraphicsContexts
based on non RGB images.
2024-09-16 16:03:34 -03:00
David Capello a21f0888ad Merge branch 'main' into beta 2024-09-03 11:26:23 -03:00
David Capello bf0a47545c Remove #if/endif ENABLE_UI conditional directives (fix #4619)
This was originated for #1279 (CLI-only Aseprite) which can be
achieved with LAF_BACKEND=none anyway.

In this way we simplify the development process, and checking for the
availability of the GUI can be done in run-time through App::isGui()
or Context::isUIAvailable().
2024-09-02 23:16:26 -03:00
David Capello ab18cd986c Update to new laf draw_text() API
As the new text::draw_text() can draw text with "native" (Skia) fonts,
we have to pass the font manager (text::FontMgr) to it, which is in
SkiaTheme. So we've added a new abstract fontMgr() member function to
ui::Theme to get the active font manager.
2024-03-07 19:23:38 -03:00
David Capello 571b4ec9f2 Update to new laf API (os::System::instance()/make()) 2024-03-05 18:50:24 -03:00
David Capello 9fb61c8a01 Use new laf-text module 2024-02-20 18:18:36 -03:00
Martín Capello 74d4154657 Set GraphicsContext.palette automatically when a Sprite's indexed image
or tileset's tile indexed image is drawn
2023-09-25 18:30:36 -03:00
Martín Capello d777a9a325 [lua] Add GraphicsContext.palette property to set the palette used to draw indexed images 2023-09-25 18:30:36 -03:00
Martín Capello 94b5158a5d Fix blend mode usage for GraphicsContext:drawImage(image, x, y) (fix #3960) 2023-09-25 18:30:36 -03:00
Martín Capello 0958573cac Add canvas autoScaling feature (fix #3748) 2023-04-27 11:07:26 -03:00
David Capello 53c851c547 [lua] Add GraphicsContext:oval() function 2023-03-23 14:56:01 -03:00
David Capello f6df07ada6 [lua] Change GraphicsContext.opacity to an integer value from 0..255
To match the opacity of Layer and Cel.
2023-03-20 15:51:30 -03:00
David Capello 17c66181ae [lua] Replace Paint() class with GraphicsContext.blendMode/opacity properties
In some way we prefer to simplify the GraphicsContext class instead of
exposing a new Paint() class (which might be confusing with the
app.useTool() too).

Now BlendMode can be used for GraphicsContext.blendMode and
Layer.blendMode (not all modes are available in both cases).

This reverts commit 3d7c05c8f1.
2023-03-13 21:19:23 -03:00
David Capello 3d7c05c8f1 [lua] Add Paint class and argument to GraphicsContext::drawImage(img, srcRc, dstRc, paint) function 2023-03-13 18:18:44 -03:00
David Capello 87cd81b9f6 [lua] Cache temporal surface in GraphicsContext::drawImage() 2023-03-13 17:10:25 -03:00
David Capello c280732fb1 [lua] Use SrcOver blend mode for GraphicsContext::drawImage() 2023-03-13 17:10:09 -03:00
David Capello 705cc3af50 Fix assert failing when drawing an image with empty source bounds 2023-01-12 16:20:53 -03:00
David Capello 7460e5f830 [lua] Add support to paint horizontal/vertical theme parts (e.g. separators) 2023-01-10 16:58:28 -03:00
David Capello cdab75beed [lua] Add GraphicsContext:drawImage(image, srcRect, dstRect) 2022-12-21 19:08:46 -03:00
David Capello f23adb0b1a [lua] Add GraphicsContext:clip()/rect()/roundedRect() functions 2022-12-21 19:07:43 -03:00
David Capello 39109793a9 [lua] Add GraphicsContext:drawImage(img, x, y, w, h, dx, dy, dw, dh) 2022-12-19 16:39:59 -03:00
David Capello a98f81288d [lua] Add GraphicsContext:drawThemeImage/Rect() functions
Maybe not the best API, but the simplest, in the future we could cache
the part using its ID with something like: app.theme.parts.part_id
2022-12-15 19:41:13 -03:00
David Capello 789e857d98 [lua] Add path functions to GraphicsContext object 2022-12-15 16:22:22 -03:00
David Capello b42a8b7ecf [lua] Add fillText() and measureText() functions to GraphicsContext 2022-12-15 10:01:13 -03:00
David Capello 2cb526a19b [lua] Add new GraphicsContext type for Canvas onpaint event
We include a simple initial API for the GraphicsContext (like
stroking/filling rectangles and images).
2022-12-14 18:59:44 -03:00