added "extend" transform for pre3d rendering - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/pre3d/pre3d.lua
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年07月15日 13:57:44 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年07月15日 13:57:44 +0200
commit426d707efc9845a1230a8f8fa984338719a151a7 (patch)
tree48a31d20eca434223347dd10bb9fba58df059bc0 /pre3d/pre3d.lua
parentf93eaab58d78528b56710dbdbcf0b0232d1f46ad (diff)
downloadgsl-shell-426d707efc9845a1230a8f8fa984338719a151a7.tar.gz
added "extend" transform for pre3d rendering
The "extend" transform corresponds to agg::conv_contour and it allows to extend/shrink a polygon. Removed the on_draw callback.
Diffstat (limited to 'pre3d/pre3d.lua')
-rw-r--r--pre3d/pre3d.lua 26
1 files changed, 5 insertions, 21 deletions
diff --git a/pre3d/pre3d.lua b/pre3d/pre3d.lua
index c2592ebe..2c379f44 100644
--- a/pre3d/pre3d.lua
+++ b/pre3d/pre3d.lua
@@ -822,26 +822,6 @@ function RendererMT.drawBuffer(this)
local is_triangle = qf:isTriangle()
- if obj.draw_overdraw then
- -- Unfortunately when we fill with canvas, we can get some gap looking
- -- things on the edges between quads. One possible solution is to
- -- stroke the path, but this turns out to be really expensive. Instead
- -- we try to increase the area of the quad. Each edge pushes its
- -- vertices away from each other. This is sort of similar in concept
- -- to the builtin canvas shadow support (shadowOffsetX, etc). However,
- -- Chrome doesn't support shadows correctly now. It does in trunk, but
- -- using shadows to fill the gaps looks awful, and also seems slower.
-
- pushPoints2dIP(qf.i0, qf.i1)
- pushPoints2dIP(qf.i1, qf.i2)
- if is_triangle then
- pushPoints2dIP(qf.i2, qf.i0)
- else
- pushPoints2dIP(qf.i2, qf.i3)
- pushPoints2dIP(qf.i3, qf.i0)
- end
- end
-
-- Create our quad as a <canvas> path.
local qpath = path(qf.i0.x, qf.i0.y)
qpath:line_to(qf.i1.x, qf.i1.y)
@@ -854,7 +834,11 @@ function RendererMT.drawBuffer(this)
-- Fill...
local frgba = obj.fill_rgba
if frgba then
- win:draw(qpath, frgba)
+ if obj.draw_overdraw then
+ win:draw(qpath, frgba, {{'extend'}})
+ else
+ win:draw(qpath, frgba)
+ end
end
-- Stroke...
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月17日 13:17:49 +0000

AltStyle によって変換されたページ (->オリジナル) /