Commit 47eedaa5 authored by user's avatar user
Browse files

fix bug with textarea placement

parent 2fbb26ea
......@@ -3489,15 +3489,17 @@ function select_text(cid, elem) {
function gui_textarea(cid, tag, x, y, max_char_width, text, font_size, state) {
gui_post("x/y is " + x + '/' + y);
gui_post("state? " + state);
var range;
var range, svg_view;
if (state !== 0) {
var p = patchwin[cid].window.document.createElement('p');
configure_item(p, {
id: 'new_object_textentry'
});
svg_view = patchwin[cid].window.document.getElementById('patchsvg')
.viewBox.baseVal;
p.contentEditable = 'true';
p.style.setProperty('left', x + 'px');
p.style.setProperty('top', y + 'px');
p.style.setProperty('left', (x - svg_view.x) + 'px');
p.style.setProperty('top', (y - svg_view.y) + 'px');
p.style.setProperty('font-size', font_size + 'px');
p.style.setProperty('transform', 'translate(0px, 0px)');
p.style.setProperty('max-width',
......
......@@ -604,6 +604,9 @@ void rtext_activate(t_rtext *x, int state)
*/
widthspec = x->x_text->te_width; // width if any specified
/* we need to get scroll to make sure we've got the
correct bbox for the svg */
canvas_getscroll(glist_getcanvas(canvas));
gui_vmess("gui_textarea", "xsiiisii",
canvas,
x->x_tag,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment