Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging Plotter crossplatform fixes trunk->3.4 (revs 9931 9934 9941 9…

…942)

git-svn-id: https://supercollider.svn.sourceforge.net/svnroot/supercollider/branches/3.4@9954 a380766d-ff14-0410-b294-a243070f3f08
  • Loading branch information...
commit 98d24f112de1a9e473071c100e57c09828aa8af0 1 parent b4d615a
@danstowell danstowell authored
View
1  common/build/ChangeLog
@@ -93,6 +93,7 @@ Other additions/improvements:
* 2010-02-09 rearrangement of supercollider source code tree - ds
* 2010-02-11 Server:default_ now assigns to s by default. Settable with flag - sw
* 2010-02-27 removed SCAnimationView and added SCUserView:animate_ - fo
+* 2010-03-10 SCPen:setSmoothing changed to SCPen:smoothing_, harmonised change with swingosc - ds
SuperCollider v3.3.1, released 2009-06-19
=========================================
View
2  common/build/Help/GUI/Cocoa-GUI/SCImage/SCImage.html
@@ -457,7 +457,7 @@
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>ratio = height / width;</p>
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>i = <span class="s1">SCImage</span>(width@(height));</p>
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>i.draw({<span class="s1">|bb|</span></p>
-<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s1">SCPen</span>.setSmoothing(<span class="s1">false</span>);</p>
+<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s1">SCPen</span>.smoothing_(<span class="s1">false</span>);</p>
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>i.drawStringAtPoint(str, 0@0, font, color);</p>
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>});</p>
<p class="p11"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>i.interpolation_(<span class="s13">\none</span>);</p>
View
2  common/build/Help/GUI/GUI-Tools/Plotter.html
@@ -325,7 +325,7 @@
<p class="p18"><span class="s8">a.makeWindow;<span class="Apple-tab-span"> </span></span>// open it again</p>
<p class="p3"><br></p>
<p class="p8">a.value = { (0..70).scramble }.dup(3);</p>
-<p class="p8">a.plotMode = <span class="s14">\lines</span>; a.refresh;</p>
+<p class="p8">a.plotMode = <span class="s14">\linear</span>; a.refresh;</p>
<p class="p8">a.value = { <span class="s5">|i|</span> (0..2000).normalize(0, 4pi + i).sin } ! 4; <span class="s12">// lots of values, test efficiency</span></p>
<p class="p8">a.value = { <span class="s5">|i|</span> (0..10000).normalize(0, 8pi + i).sin } ! 3; <span class="s12">// lots of values, test efficiency</span></p>
<p class="p8">a.value = { (0..140).scramble } ! 7;</p>
View
63 common/build/SCClassLibrary/Common/GUI/PlusGUI/Math/PlotView.sc
@@ -10,21 +10,22 @@ Plot {
var valueCache;
*initClass {
- GUI.skin.put(\plot, (
- plotFont: GUI.current !? { Font("Courier" , 9) },
- gridFont: GUI.current !? { Font("Garamond", 9) },
- gridColorX: Color.grey(0.7),
- gridColorY: Color.grey(0.7),
- fontColor: Color.grey(0.3),
- plotColor: [Color.black, Color.blue, Color.red, Color.green(0.7)],
- background: Color.new255(235, 235, 235),
- //gridLinePattern: FloatArray[1, 5],
- gridLinePattern: FloatArray[1, 0],
- gridLineSmoothing: false,
- labelX: "",
- labelY: "",
- expertMode: false
- ));
+ StartUp.add( {
+ GUI.skin.put(\plot, (
+ gridFont: GUI.current !? { Font("Garamond", 9) },
+ gridColorX: Color.grey(0.7),
+ gridColorY: Color.grey(0.7),
+ fontColor: Color.grey(0.3),
+ plotColor: [Color.black, Color.blue, Color.red, Color.green(0.7)],
+ background: Color.new255(235, 235, 235),
+ //gridLinePattern: FloatArray[1, 5],
+ gridLinePattern: FloatArray[1, 0],
+ gridLineSmoothing: false,
+ labelX: "",
+ labelY: "",
+ expertMode: false
+ ));
+ } );
}
*new { |plotter|
@@ -112,7 +113,9 @@ Plot {
this.drawOnGridX { |hpos, val, i|
var string = val.asStringPrec(5) ++ domainSpec.units;
- string.drawAtPoint(hpos @ base, font, fontColor);
+ Pen.font = font;
+ Pen.strokeColor = fontColor;
+ Pen.stringAtPoint( string, hpos @ base);
};
Pen.stroke;
@@ -126,7 +129,9 @@ Plot {
this.drawOnGridY { |vpos, val, i|
var string = val.asStringPrec(5).asString ++ spec.units;
if(gridOnX.not or: { i > 0 }) {
- string.drawAtPoint(left @ vpos, font, fontColor);
+ Pen.font = font;
+ Pen.strokeColor = fontColor;
+ Pen.stringAtPoint( string, left @ vpos);
}
};
@@ -180,15 +185,19 @@ Plot {
var sbounds;
if(gridOnX and: { labelX.notNil }) {
sbounds = try { labelX.bounds(font) } ? 0;
- labelX.drawAtPoint(
- plotBounds.right - sbounds.width @ plotBounds.bottom, font, fontColor
+ Pen.font = font;
+ Pen.strokeColor = fontColor;
+ Pen.stringAtPoint( labelX,
+ plotBounds.right - sbounds.width @ plotBounds.bottom
)
};
if(gridOnY and: { labelY.notNil }) {
sbounds = try { labelY.bounds(font) } ? 0;
- labelY.drawAtPoint(
- plotBounds.left - sbounds.width - 3 @ plotBounds.top, font, fontColor
- )
+ Pen.font = font;
+ Pen.strokeColor = fontColor;
+ Pen.stringAtPoint( labelY,
+ plotBounds.left - sbounds.width - 3 @ plotBounds.top
+ )
};
}
@@ -268,7 +277,7 @@ Plot {
}
levels { |x, y|
- Pen.setSmoothing(false);
+ Pen.smoothing_(false);
y.size.do { |i|
Pen.moveTo(x[i] @ y[i]);
Pen.lineTo(x[i + 1] ?? { plotBounds.right } @ y[i]);
@@ -276,7 +285,7 @@ Plot {
}
steps { |x, y|
- Pen.setSmoothing(false);
+ Pen.smoothing_(false);
Pen.moveTo(x.first @ y.first);
y.size.do { |i|
Pen.lineTo(x[i] @ y[i]);
@@ -339,14 +348,14 @@ Plot {
Pen.width = 1;
try {
- Pen.setSmoothing(gridLineSmoothing);
+ Pen.smoothing_(gridLineSmoothing);
Pen.lineDash_(gridLinePattern);
};
Pen.stroke;
try {
- Pen.setSmoothing(true);
+ Pen.smoothing_(true);
Pen.lineDash_(FloatArray[1, 0])
};
}
@@ -548,7 +557,7 @@ Plotter {
updatePlotBounds {
var deltaY = if(data.size > 1 ) { 4.0 } { 0.0 };
var distY = bounds.height / data.size;
- var height = max(20, distY - deltaY);
+ var height = distY - deltaY;
plots.do { |plot, i|
plot.bounds_(
View
5 common/build/SCClassLibrary/Common/GUI/osx/scide_scapp/Base/SCPen.sc
@@ -160,6 +160,11 @@ classvar fnt, fillColor, strokeColor;
}
*setSmoothing { arg flag=true;
+ this.deprecated(thisMethod, Meta_SCPen.findRespondingMethodFor(\smoothing_));
+ this.smoothing = flag;
+ }
+
+ *smoothing_ { arg flag=true;
_Pen_SetSmoothing
^this.primitiveFailed
}
View
4 common/build/examples/GUI examples/strike.scd
@@ -32,7 +32,7 @@ GUI.swing; // use Java GUI
pen = GUI.pen;
w.drawHook = {
// set the Color
- try { pen.setSmoothing(false) };
+ try { pen.smoothing_(false) };
pen.width = width;
z.do { |i|
pen.strokeColor = Color.rand.alpha_(i.linexp(0, z-1, 1.0, alph));
@@ -98,7 +98,7 @@ GUI.swing; // use Java GUI
pen = GUI.pen;
w.drawHook = {
- try {pen.setSmoothing(false) };
+ try { pen.smoothing_(false) };
pen.width = width;
Please sign in to comment.
Something went wrong with that request. Please try again.