mirror of
https://github.com/godotengine/godot-website-cover-generator.git
synced 2025-12-31 01:49:34 +03:00
Add "Include the Godot logo?" checkbox
This commit is contained in:
@@ -40,6 +40,11 @@
|
||||
|
||||
<h3>Fine tuning</h3>
|
||||
|
||||
<div class="toolbar-item toolbar-item--oneline">
|
||||
<label for="include-godot-logo">Include the Godot logo?</label>
|
||||
<input type="checkbox" id="include-godot-logo" checked="true">
|
||||
</div>
|
||||
|
||||
<div class="toolbar-item toolbar-item--oneline">
|
||||
<label for="clear-color">Clear color</label>
|
||||
<input type="color" id="clear-color" value="#000000" />
|
||||
|
||||
@@ -31,6 +31,7 @@ class PreviewGenerator {
|
||||
* @type Image
|
||||
*/
|
||||
this.godotLogo = null;
|
||||
this.includeGodotLogo = true;
|
||||
|
||||
// State parameters.
|
||||
|
||||
@@ -134,6 +135,11 @@ class PreviewGenerator {
|
||||
this._debounceUpdateAndRender();
|
||||
});
|
||||
|
||||
const includeGodotLogo_input = document.getElementById("include-godot-logo");
|
||||
includeGodotLogo_input.addEventListener("input", () => {
|
||||
this._debounceUpdateAndRender();
|
||||
});
|
||||
|
||||
const clearColor_input = document.getElementById("clear-color");
|
||||
clearColor_input.addEventListener("input", () => {
|
||||
this._debounceUpdateAndRender();
|
||||
@@ -345,7 +351,7 @@ class PreviewGenerator {
|
||||
this.ctx.fillRect(paddingSize, this.previewHeight - breaklineOffset - breaklineHeight, breaklineWidth, breaklineHeight);
|
||||
|
||||
// Render the Godot logo.
|
||||
if (this.godotLogo) {
|
||||
if (this.godotLogo && this.includeGodotLogo) {
|
||||
const logoWidth = 0.36 * this.previewWidth;
|
||||
const logoHeight = this.godotLogo.height * (logoWidth / this.godotLogo.width);
|
||||
|
||||
@@ -377,6 +383,9 @@ class PreviewGenerator {
|
||||
|
||||
this._updateFilename();
|
||||
|
||||
const includeGodotLogo_input = document.getElementById("include-godot-logo");
|
||||
this.includeGodotLogo = includeGodotLogo_input.checked;
|
||||
|
||||
const clearColor_input = document.getElementById("clear-color");
|
||||
this.clearColor = clearColor_input.value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user