2013-02-11 48 views
0

我一直在檢查我的項目的一些代碼,並發現了一些有趣的與光滑的()方法光滑()方法級別參數

以下相關PApplet和PGraphics類是從PAppplet.java

的代碼段
public void smooth() { 
    if (recorder != null) recorder.smooth(); 
    g.smooth(); 
} 

public void smooth(int level) { 
    if (recorder != null) recorder.smooth(level); 
    g.smooth(level); 
} 

這裏g和記錄器對象是在該類PGraphics.java類和實例,這裏有平滑的方法:

public void smooth() { 
    smooth = true; 
} 
/** 
* 
* @param level either 2, 4, or 8 
*/ 
public void smooth(int level) { 
    smooth = true; 
} 

基本上,設置不同級別的順暢似乎沒有工作。我試圖把不同的數字,如32 64 8等,但結果並沒有改變。並且你可以查看http://processing.org/reference/smooth_.html上的api頁面,它表示平滑級別應該可以工作,但是簡單地說它沒有。

任何人都可以解釋爲什麼上面的代碼不要做任何與水平的東西,雖然它是寫在API?

回答

0

你沒有看公共API,該代碼是編譯Processing解釋器的內部代碼。所以:歡迎來到現實世界,文檔和代碼並不總是同意,特別是當一個項目正在加緊推出新的完整版本時。如果您想了解這從開發商的答案,你可能想直接通過了對新的GitHub代碼回購發佈提問問他們:https://github.com/processing/processing

(以供將來參考:API被記錄在http://processing.org/reference如果它不存在提及。 ,即使它在源代碼中,它也不是API的一部分,它可以讓解釋器在Java編譯時完成它的工作)