1
0
mirror of https://github.com/psychopy/psychojs.git synced 2025-05-10 10:40:54 +00:00

final touches;

This commit is contained in:
lgtst 2022-06-28 10:34:44 +03:00
parent 0f07245e39
commit e5f4be1711

View File

@ -146,7 +146,7 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
this._addAttribute( this._addAttribute(
"alignment", "alignment",
alignment, alignment,
"left" "center"
); );
this._addAttribute( this._addAttribute(
"languageStyle", "languageStyle",
@ -245,7 +245,7 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
* @param {boolean} alignment - alignment of the text * @param {boolean} alignment - alignment of the text
* @param {boolean} [log= false] - whether or not to log * @param {boolean} [log= false] - whether or not to log
*/ */
setAlignment(alignment = "left", log = false) setAlignment(alignment = "center", log = false)
{ {
this._setAttribute("alignment", alignment, log); this._setAttribute("alignment", alignment, log);
if (this._pixi !== undefined) { if (this._pixi !== undefined) {
@ -531,10 +531,8 @@ export class TextBox extends util.mix(VisualStim).with(ColorMixin)
return { return {
// input style properties eventually become CSS, so same syntax applies // input style properties eventually become CSS, so same syntax applies
input: { input: {
// display: "inline-block",
display: "flex", display: "flex",
flexDirection: "column", flexDirection: "column",
fontFamily: this._font, fontFamily: this._font,
fontSize: `${letterHeight_px}px`, fontSize: `${letterHeight_px}px`,
color: this._color === undefined || this._color === null ? 'transparent' : new Color(this._color).hex, color: this._color === undefined || this._color === null ? 'transparent' : new Color(this._color).hex,