Skip to content

Commit

Permalink
Insert color literals before certain whatsits
Browse files Browse the repository at this point in the history
Hopefully fixes olsak#73 and other
potential issues.
  • Loading branch information
vlasakm committed Aug 27, 2021
1 parent 24cad80 commit 7f031f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions optex/base/optex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,17 @@ end, "_tracingmacros")
-- inject PDF literals according to attributes.
--
local node_id = node.id
local node_subtype = node.subtype
local glyph_id = node_id("glyph")
local rule_id = node_id("rule")
local glue_id = node_id("glue")
local hlist_id = node_id("hlist")
local vlist_id = node_id("vlist")
local disc_id = node_id("disc")
local whatsit_id = node_id("whatsit")
local pdfliteral_id = node_subtype("pdf_literal")
local pdfsave_id = node_subtype("pdf_save")
local pdfrestore_id = node_subtype("pdf_restore")
local token_getmacro = token.get_macro

local direct = node.direct
Expand Down Expand Up @@ -517,6 +522,10 @@ local function is_color_needed(head, n, id, subtype) -- returns non-stroke, stro
return true, true
end
return true, false
elseif id == whatsit_id and (subtype == pdfliteral_id
or subtype == pdfsave_id
or subtype == pdfrestore_id) then
return true, true
end
return false, false
end
Expand Down

0 comments on commit 7f031f0

Please sign in to comment.