Denis Auroux twisted the bytes to say:
Hi Immi, what do you think? It sounds reasonable to me. Denis> Hah. It's a bit of a hack, but here's a proposal that fully preserves file format compatibility: Denis> * We add one more width as Immi would like us to (presumably this is the width at the start of the stroke -- I looked at Denis> my code and it only measures the pressure/width at the end of each segment -- we only call get_pressure_in Denis> continue_stroke(), so the extra width that Immi needs to store presumably comes before the others) -- but we also add Denis> one more xy point: we record twice the starting point of the stroke. Denis> * Then the existing versions of xournal and the sequence-of-line-segments renderer should be able to treat this just Denis> fine if they read this kind of stroke data -- it would just start by drawing a length zero segment. Meanwhile, the Denis> trapezoid renderer would either ignore the initial length zero segment if there is one [for data coming from the new Denis> xournal], or if the initial segment does not have length zero, draw a line or a triangle [note: the initial nonzero Denis> length segment indicates that we're missing one piece of width data because the file came from an older xournal, so one Denis> needs to improvise], and then draw trapezoids for the subsequent line segments as required. Denis> (Sorry if this is a bit confusing. Old format = we store n+1 distinct points and n widths for the end of each segment Denis> i.e. no width data at the starting point; new format = we store the first point twice, ending up with n+2 points in Denis> total, and n+1 widths at all the distinct points (= the ends of the segments if you include the duplicated first point Denis> in the list). Then there's enough data for the trapezoid renderer if the first point is duplicated [otherwise, in Denis> existing xoj files there isn't quite enough width data for the trapezoid renderer and the first line segment needs to be Denis> treated creatively], and the duplicated xy-point allows old versions of xournal to think that this is just a sequence of Denis> widths for the segments, the first width being for a bogus length 0 segment.) Denis> Does this make sense? [as in: do you agree it would work?] Does it make sense? [as in: do we think it's worth Denis> introducing such a hack to preserve compatibility?] By the way, I did as Denis instructed me and got two screenshots of very zoomed lines. Nice, Immi, i see the advantages:
--dmg -- Daniel M. German http://turingmachine.org/ http://silvernegative.com/ dmg (at) uvic (dot) ca replace (at) with @ and (dot) with .
------------------------------------------------------------------------------
_______________________________________________ Xournal-devel mailing list Xournal-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xournal-devel