<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: Mgraphics not drawing stroke properly</title>
		<atom:link href="http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/feed</link>
		<description></description>
		<pubDate>Thu, 20 Jun 2013 02:59:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-65623</guid>
					<title><![CDATA[Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-65623</link>
					<pubDate>Mon, 10 Dec 2012 23:19:33 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>If you run the following code&#8230;</p>
<p>autowatch = 1;</p>
<p>var width = 500;<br />
var height = 300;<br />
var mgfx = new MGraphics(width,height);</p>
<p>mgfx.init();<br />
mgfx.relative_coords = 0;<br />
mgfx.autofill = 0;</p>
<p>var outmatrix = new JitterMatrix(4, &#8220;char&#8221;, width, height);</p>
<p>mgfx.redraw();</p>
<p>function bang()<br />
{<br />
  draw();<br />
}</p>
<p>function draw()<br />
{<br />
  var theImage = null;</p>
<p>  background(255);</p>
<p>  mgfx.rectangle(0, 0, 100, 100);</p>
<p>  mgfx.set_source_rgba(0, 0, 0, 1);<br />
  mgfx.stroke_preserve();</p>
<p>  mgfx.set_source_rgba(0, 1, 1, 1);<br />
  mgfx.fill();</p>
<p>  mgfx.identity_matrix();<br />
  theImage = new Image(mgfx.pop_group());<br />
  mgfx.image_surface_draw(theImage);</p>
<p>  theImage.tonamedmatrix(outmatrix.name);<br />
  outlet(0, &#8220;jit_matrix&#8221;, outmatrix.name);</p>
<p>  gc();</p>
<p>}</p>
<p>function clearBackground() {<br />
  background(0);<br />
}</p>
<p>function clearBackground() {<br />
  background(0);<br />
}</p>
<p>You will see that two sides of the border stroke are missing.<br />
Did I get something wrong here?</p>
<p>-ap</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236402</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236402</link>
					<pubDate>Wed, 12 Dec 2012 16:53:35 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>Is this a bug or am I doing something wrong?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236403</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236403</link>
					<pubDate>Fri, 14 Dec 2012 16:59:14 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>Anybody?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236404</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236404</link>
					<pubDate>Mon, 17 Dec 2012 15:14:33 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>Surely someone here knows something about mgraphics.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236405</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236405</link>
					<pubDate>Mon, 17 Dec 2012 19:35:46 +0000</pubDate>
					<dc:creator>Frederic Dufeu</dc:creator>

					<description>
						<![CDATA[
						<p>Hi Anthony,</p>
<p>Not sure about what you&#8217;re trying to achieve here but it sounds like you&#8217;d want to revert the stroke and fill operations:<br />
// first<br />
fill_preserve()<br />
// then<br />
stroke() </p>
<p>Best,<br />
Frédéric</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236407</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236407</link>
					<pubDate>Mon, 17 Dec 2012 21:40:54 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>Let me rephrase my problem. My objective is to see a shape with a border around it.<br />
The code I have now, draws the shape then the frame. What I should see is NOTHING.<br />
The shape should cover the frame. What you actually see is a square with two sides<br />
of the border.</p>
<p>If I reverse it, as you suggested, I see the frame but two of the sides are twice as thick.<br />
I have included a test patch.</p>
<p>autowatch = 1;</p>
<p>var width = 500;<br />
var height = 300;<br />
var mgfx = new MGraphics(width,height);</p>
<p>mgfx.init();<br />
mgfx.relative_coords = 0;<br />
mgfx.autofill = 0;</p>
<p>var outmatrix = new JitterMatrix(4, &#8220;char&#8221;, width, height);</p>
<p>mgfx.redraw();</p>
<p>function bang()<br />
{<br />
	draw();<br />
}</p>
<p>function draw()<br />
{<br />
	var theImage = null;</p>
<p>	background(255);</p>
<p>mgfx.rectangle(0, 0, 100, 100);</p>
<p>mgfx.set_source_rgba(0, 1, 1, 1);<br />
mgfx.fill_preserve();</p>
<p>mgfx.set_source_rgba(0, 0, 0, 1);<br />
mgfx.stroke_preserve();</p>
<p>mgfx.identity_matrix();<br />
theImage = new Image(mgfx.pop_group());<br />
mgfx.image_surface_draw(theImage);</p>
<p>theImage.tonamedmatrix(outmatrix.name);<br />
outlet(0, &#8220;jit_matrix&#8221;, outmatrix.name);</p>
<p>gc();</p>
<p>}</p>
<p>function clearBackground() {<br />
	background(0);<br />
}</p>
<p>function background(rgb) {<br />
  with (mgfx)<br />
  {<br />
      set_source_rgb(rgb/255, rgb/255, rgb/255);<br />
    rectangle(0, 0, width, height);<br />
    fill();<br />
  }<br />
}</p>
<div><span id="toggle236407-0" class="patchtoggle" onmousedown="toggleMaxPatch('post236407-0', 'er236407-0');">&#8211; Pasted Max <span id="maxversion236407-0"></span> Patch, click to <span id="er236407-0">expand</span>. &#8211;</span> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"  width="110" height="14" class="clippy" ><param name="allowScriptAccess" value="always" /><param name="quality" value="high" /><param name="scale" value="noscale" /><param NAME="FlashVars" value="copied=copied!&#038;copyto=copy to clipboard"/><param name="bgcolor" value="#FFFFFF"/><param name="wmode" value="opaque"/><embed src="/wp-content/plugins/bbpress-copy-compressed/clippy.swf"  width="110" height="14"   name="clippy"  quality="high"  allowScriptAccess="always"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"  FlashVars="text=----------begin_max5_patcher----------%0A535.3ocyVssiaBCD8Y3q.4mSi3RIMz252wpUQlvTVi.aj8jKsq1%2B8hGfTxlP%0AB6pHz9xD4wlYNmy3Ybd00gkpNBFl2O8dxyw4UWGGxk0gS2ZGVE%2B31RtgNFqB%0ALFdNvVztGBGQx%2B1Rfq68J2Uo1gk.ReSPm2eqjnQ7Wf7Etzuyc6Iw%2BTCs3fw7%0AdtaqZNt8EgLeiF1hs6Fjrp4K8hBI6Or1f0K8O8IhLBNpzhuEDxFjYIuhR.6W%0AZAub.RExdfFZ88lqq0rXh5gDNzjqKjiJ.0JuvX%2BGijjxk42VVhrJwJexFasg%0A9inJ9yfpfp77R31b%2BBRJj3D3XakOz%2BVbLgcJJ5FBhfdCH4okTl7uFIC9Djbz%0AVAUUs3dr%2BwzLz0FP13va0LDMCU8BAtr9fPloNbcxG1SEMX.IxQgRNfNITQs0%0AF6S%2BD4OrDeo5r3dJDMgHIbzPNThhYOpqFo6PTI%2Bf2%2BuaSdxja.V%2BvXxHy2JL%0AdHXvkElY3Zdxfgawe%2BV7N9CdKuGlF9dHaSSDZx4FNhZQSEr8gQmSBSSTaZqO%0AE0y4%2BHyZn8HIuW3IXyJEx2%2BtKQbq%2ByqFF0N81dYp%2BYMu%2By9rFXHjTqzfCEe1%0AYdQjkAxgC%2BxDFKFyNAxKtVLU3D8kBMwS.MQyGbV%2BkRbRl.Zr%2B8fYBNuKUWGO%0Aq%2BjvosMiWWuGzltPRHoY7VgRaWtZAsTHaWRQjog8h9yu10Fs2b%2BGNGTjZA%0A-----------end_max5_patcher-----------&#038;copied=copied!&#038;;copyto=copy to clipboard"  bgcolor="#ffffff"  wmode="opaque" /> </object></div>
<div id="post236407-0" style="display:none;visibility:hidden;" >
<div class="patchtoggleInfo"><small>Copy <b>all</b> of the following text.Then, in Max, select <em>New From Clipboard</em>.</small></div>
<div class="patchtogglediv">
<pre><code id="pastedcode236407-0">----------begin_max5_patcher----------
535.3ocyVssiaBCD8Y3q.4mSi3RIMz252wpUQlvTVi.aj8jKsq1+8hGfTxlP
B6pHz9xD4wlYNmy3Ybd00gkpNBFl2O8dxyw4UWGGxk0gS2ZGVE+31RtgNFqB
LFdNvVztGBGQx+1Rfq68J2Uo1gk.ReSPm2eqjnQ7Wf7Etzuyc6Iw+TCs3fw7
dtaqZNt8EgLeiF1hs6Fjrp4K8hBI6Or1f0K8O8IhLBNpzhuEDxFjYIuhR.6W
ZAub.RExdfFZ88lqq0rXh5gDNzjqKjiJ.0JuvX+Gijjxk42VVhrJwJexFasg
9inJ9yfpfp77R31b+BRJj3D3XakOz+VbLgcJJ5FBhfdCH4okTl7uFIC9Djbz
VAUUs3dr+wzLz0FP13va0LDMCU8BAtr9fPloNbcxG1SEMX.IxQgRNfNITQs0
F6S+D4OrDeo5r3dJDMgHIbzPNThhYOpqFo6PTI+f2+uaSdxja.V+vXxHy2JL
dHXvkElY3Zdxfgawe+V7N9CdKuGlF9dHaSSDZx4FNhZQSEr8gQmSBSSTaZqO
E0y4+HyZn8HIuW3IXyJEx2+tKQbq+yqFF0N81dYp+YMu+y9rFXHjTqzfCEe1
YdQjkAxgC+xDFKFyNAxKtVLU3D8kBMwS.MQyGbV+kRbRl.Zr+8fYBNuKUWGO
q+jvosMiWWuGzltPRHoY7VgRaWtZAsTHaWRQjog8h9yu10Fs2b+GNGTjZA
-----------end_max5_patcher-----------</code></pre></div>
</div>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236408</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236408</link>
					<pubDate>Mon, 17 Dec 2012 22:10:06 +0000</pubDate>
					<dc:creator>Frederic Dufeu</dc:creator>

					<description>
						<![CDATA[
						<p>I believe your issue will be clearer if you don&#8217;t do the drawings at the upleft bounds of the jit.pwindow. See for instance what is happening when replacing mgfx.rectangle(0, 0, 100, 100) with mgfx.rectangle(10, 10, 100, 100).</p>
<p>In both cases you have to consider that stroke() has an irreducible thickness. Maybe try to experiment with function set_line_width(f) with f less than 1.</p>
<p>Hope that helps,</p>
<p>Best,<br />
Frédéric</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236409</guid>
					<title><![CDATA[Re: Mgraphics not drawing stroke properly]]></title>
					<link>http://cycling74.com/forums/topic/mgraphics-not-drawing-stroke-properly/#post-236409</link>
					<pubDate>Mon, 17 Dec 2012 23:14:34 +0000</pubDate>
					<dc:creator>Anthony Palomba</dc:creator>

					<description>
						<![CDATA[
						<p>Ahhh you are right, starting at (0, 0) seems to clip the top and left side of the<br />
border, which is why it is not seen. Thanks Frederic for helping me sort this out!</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

