Skip to content

Commit 1bfb7fc

Browse files
committed
右クリックで初期表示の色がおかしかったので修正
1 parent 5e6fcd0 commit 1bfb7fc

File tree

5 files changed

+34
-8
lines changed

5 files changed

+34
-8
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ <h5 data-i18n="comfyUI">ComfyUI</h5>
20442044
<script src="third/font-awesome/all.min.js"></script>
20452045
<script src="third/localforage/localforage.min.js"></script>
20462046

2047-
<script src="js/sidebar/pen/fabric/dist/fabric-brush.min.js?v=7.2"></script>
2047+
<script src="js/sidebar/pen/fabric/fabric-brush.min.js?v=7.2"></script>
20482048
<script src="js/sidebar/pen/fabric/brushes/crayon_brush.js?v=7.2"></script>
20492049
<script src="js/sidebar/pen/fabric/brushes/ink_brush.js?v=7.2"></script>
20502050
<script src="js/sidebar/pen/fabric/brushes/marker_brush.js?v=7.2"></script>

js/sidebar/pen/fabric/fabric-brush.min.js

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/sidebar/speechBubble/speech-bubble-effect.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ function getSpeechBubbleTextFill(activeObject, type){
105105
}
106106

107107
if(type == 'fill'){
108-
return "rgba(255, 255, 255, 0)";
108+
return "rgba(255, 255, 255, 1.0)";
109109
}
110110
if(type == 'stroke'){
111-
return "rgba(0, 0, 0, 0)";
111+
return "rgba(0, 0, 0, 1.0)";
112112
}
113113
if(type == 'strokeWidth'){
114114
return 10;

js/svg/speechbubble.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/ui/canvas-object-menu.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,13 @@ function createObjectMenuSlider(itemValue,min,max,step,value){
6767
return {type: 'slider',label: itemValue,
6868
options: {id:itemValue,min: min,max:max,step:step,value:value}};
6969
}
70-
function createObjectMenuColor(itemValue, defaultColor) {
70+
function createObjectMenuColor(itemValue, defaultColor, rgba) {
7171
return {
7272
type: 'colorpicker', label: itemValue,
73-
options: {id: itemValue,value: defaultColor || '#000000'}
73+
options: {id: itemValue,
74+
value: defaultColor || '#000000',
75+
rgba:rgba
76+
}
7477
};
7578
}
7679

@@ -131,8 +134,10 @@ function showObjectMenu(clickType) {
131134
min=7, max=150, step=1, value=activeObject.fontSize, labelAndId='com-fontSize';
132135
let fontSize = createObjectMenuSlider(labelAndId,min,max,step,value);
133136

134-
let fillColor = createObjectMenuColor("com-fill", rgbaToHex(fillTemp));
135-
let strokeColor = createObjectMenuColor("com-strokeColor", rgbaToHex(strokeTemp));
137+
console.log("fillTemp", fillTemp);
138+
let fillColor = createObjectMenuColor("com-fill", rgbaToHex(fillTemp), fillTemp);
139+
console.log("fillColor", fillColor);
140+
let strokeColor = createObjectMenuColor("com-strokeColor", rgbaToHex(strokeTemp), strokeTemp);
136141

137142
if (isPanel(activeObject)) {
138143
if (clickType !== 'left') {
@@ -213,8 +218,9 @@ function showObjectMenu(clickType) {
213218
<input id= "${item.options.id}"
214219
name= "${item.options.id}"
215220
value="${item.options.value}"
216-
class="jscolor-color-picker" data-initial-color="rgba(0, 0, 0, 1.0)">
221+
class="jscolor-color-picker" data-initial-color="${item.options.rgba}">
217222
</div>`;
223+
console.log("menuContent",menuContent);
218224
break;
219225
case 'button':
220226
menuContent += `<button id="fabricjs-${item.value}-btn">${getText(item.value)}</button>`;

0 commit comments

Comments
 (0)