JakAttack909 / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Minor bugs: Comment icon character is no centered AND No quotes if blockly_compressed isn't used #84

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem 1?
1. Create comment in a block

What is the expected output? What do you see instead?
Expected is that all used characters would be centered. Instead the character 
is at the bottom (add q, p or g to see it better)

What browser are you using?
Chromium-browser 18 and Firefox 15 (taken from Ubuntu Software Center)
Ubuntu version: 11.10
-------------------------------------------
What steps will reproduce the problem 1
1. delete blockly_compressed.js out of frame.html
2. Add all other required .js

What is the expected output? What do you see instead?
Expected is that everything works just as normal, but instead errors in 
../language/common/text.js occur

What browser are you using?
Chromium-browser 18 and Firefox 15 (taken from Ubuntu Software Center)
Ubuntu version: 11.10

Additional information
Two blocks use the quote pictures.
Blockly.Language.text and Blockly.Language.text_prompt.

If:
...
.appendTitle(new Blockly.FieldImage(Blockly.pathToBlockly +
'media/quote0.png', 12, 12))

is outcommented the quotes are gone but no problem occurs :) 

best regards
Marc  

Original issue reported on code.google.com by borntob...@googlemail.com on 22 Oct 2012 at 8:15

GoogleCodeExporter commented 8 years ago
With respect to the first bug, could you send a screenshot?  Looks fine to me.  
Thanks.

With respect to the second bug, I'm guessing that there's a typo on the line 
where you added field_image.js:
<script type="text/javascript" src="../core/field_image.js"></script>
See the playground test page for an example of quotes working fine while not 
using blockly_compressed:
http://blockly-demo.appspot.com/blockly/tests/playground.html

Original comment by neil.fra...@gmail.com on 23 Oct 2012 at 10:33

GoogleCodeExporter commented 8 years ago

Original comment by neil.fra...@gmail.com on 23 Oct 2012 at 10:33

GoogleCodeExporter commented 8 years ago
Bug 1:
http://home.arcor.de/borntobomb/blockly_icon_bug.png
I recently encountered, that capital letters perfectly fit. So if only capital 
letters or similar are used no boundary touches occur.

Bug 2: 
hm. If that is so i can't find my mistake.

I was wondering, why the trashbody and trashlid pictures can be found easily 
with the path value stored in blockly.pathToBlockly. In my case it's equal to 
'../../' and it shows the trashbody and lid. The 'quote' pictures are in the 
same folder and the same pathToBlockly value can't find the pictures. But this 
discussion is maybe nothing for the issue area, since I'm not sure if it is my 
mistake and what exactly it is.

but thanks for your reply and suggestion. 

Original comment by borntob...@googlemail.com on 24 Oct 2012 at 7:12

GoogleCodeExporter commented 8 years ago
Thanks for the screenshot.  Now I understand what you are doing.
I tried measuring the size of the letter and then centering it.  This failed to 
produce better results since the letter's size calculated as the distance from 
'descent' to 'ascent', regardless of whether there is a descender or ascender 
in text sample in question:
http://upload.wikimedia.org/wikipedia/commons/3/39/Typography_Line_Terms.svg
Therefore I cannot vertically align the text as you are suggesting (unless I 
were to build my own library of font metrics).
Since you appear to be editing the comment.js manually anyway (to change the 
'?' symbol), then I suggest tweaking the '3' constant one line higher.

I've just pushed a simple update (r491) which ensures that the horizontal 
centering is accurate and automatic regardless of the text content.  Sadly the 
same is not possible for vertical centering.

With respect to the quotes not loading, try going to this file in your browser:
  /core/field_image.js
(Yesterday all these files moved from the root directory to 'core', so if you 
haven't synced lately you may find they are elsewhere.)  Ensure that your 
browser can indeed load this file.  Assuming it loads, you can also try opening 
your JavaScript console on an instance of Blockly that's misbehaving and typing:
Blockly.FieldImage
This should return an object, not 'undefined'.  Also check to see if there's 
been an error reported to the console.

Original comment by neil.fra...@gmail.com on 24 Oct 2012 at 11:05

GoogleCodeExporter commented 8 years ago
Bug 1: thanks. 

Bug 2: Shame on me. I found the problem. Like always a silly one :(
Thanks for your help. It helped me to identify the location of my mistake. :)

best regards
Marc

Original comment by borntob...@googlemail.com on 25 Oct 2012 at 8:53