Adjusted pen hue wrapping and took out pen shade wrapping

pull/68/head
jmoenig 2018-10-05 09:48:11 +02:00
rodzic a8fcde724b
commit 1ff20b30b1
3 zmienionych plików z 11 dodań i 7 usunięć

Wyświetl plik

@ -2,6 +2,9 @@
## Development Version
### 2018-10-05
* Objects: Adjusted pen hue wrapping and took out pen shade wrapping
### 2018-10-04
* GUI, Cloud: improved UX when running Snap! locally without a web server
* pushed dev-version to v4.2.2

Wyświetl plik

@ -8,7 +8,7 @@
<script type="text/javascript" src="src/widgets.js?version=2018-10-02"></script>
<script type="text/javascript" src="src/blocks.js?version=2018-10-02"></script>
<script type="text/javascript" src="src/threads.js?version=2018-10-03"></script>
<script type="text/javascript" src="src/objects.js?version=2018-10-04"></script>
<script type="text/javascript" src="src/objects.js?version=2018-10-05"></script>
<script type="text/javascript" src="src/gui.js?version=2018-10-04"></script>
<script type="text/javascript" src="src/paint.js?version=2018-10-02"></script>
<script type="text/javascript" src="src/lists.js?version=2018-10-02"></script>

Wyświetl plik

@ -83,7 +83,7 @@ BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph,
AlignmentMorph, Process, XML_Element, VectorPaintEditorMorph*/
modules.objects = '2018-October-04';
modules.objects = '2018-October-05';
var SpriteMorph;
var StageMorph;
@ -3537,7 +3537,10 @@ SpriteMorph.prototype.setHue = function (num) {
y = this.yPosition(),
n = +num;
hsv[0] = (n < 0 ? 100 : 0) + n % 100 / 100;
if (n < 0 || n > 100) { // wrap the hue
n = (n < 0 ? 100 : 0) + n % 100;
}
hsv[0] = n / 100;
// hsv[0] = Math.max(Math.min(+num || 0, 100), 0) / 100; // old code
hsv[1] = 1; // we gotta fix this at some time
this.color.set_hsv.apply(this.color, hsv);
@ -3559,12 +3562,10 @@ SpriteMorph.prototype.getBrightness = function () {
SpriteMorph.prototype.setBrightness = function (num) {
var hsv = this.color.hsv(),
x = this.xPosition(),
y = this.yPosition(),
n = +num;
y = this.yPosition();
hsv[1] = 1; // we gotta fix this at some time
// hsv[2] = Math.max(Math.min(+num || 0, 100), 0) / 100; // old code
hsv[2] = (n < 0 ? 100 : 0) + n % 100 / 100;
hsv[2] = Math.max(Math.min(+num || 0, 100), 0) / 100; // shade doesn't wrap
this.color.set_hsv.apply(this.color, hsv);
if (!this.costume) {
this.drawNew();