React Native Expo QRcode generate each rectangle with BorderRadius - react-native

I'm using the react-native-qrcode-svg package, but when I try to implement a simple QR code, this image returns.
I already tried removing all the styles, but keep returning the same image,
this is the code that i am using
<QRCode value="http://awesome.link.qr"/>
UPDATE
I was reviewing the code of the package and I noticed that it uses the Path to draw each box, check in the documentation and for some reason it has the property by default
strokeLinecap={'square'}
I had to specify that it was square, I also had to modify the width and height of each square, because they are poorly positioned.
I did that in the file
./node_modules/react-native-qrcode-svg/src/transformMAtrixIntoPath.js
I really don't know if I did it right, or there is another way much easier to solve, but for the moment that solved it

For someone who has the same problem, I fixed it like this:
ADD strokeLinecap={'square'} on Line 141, as property of at index.js file
Head to tranformMatrixIntoPath.js file and modify the algorithm
UPDATE Line 2 add const cellSize = size / matrix.length - 0.1
UPDATE Line 9 add path += 'M${cellSize * j + 9} ${cellSize / 2 + cellSize * i}'

Related

Halcon - Move XLD line

I have a Iconic variable BackWallBoundaryLineXLD
It containts 2 points and the line connecting them.
I would need to move this line upwards 40 pixels, so basically change the row coordinate of the line to Currentvalue-40.
Is there a simple and clean way to do it, or do I have to extract the points first, edit them and then draw a new line?
Try
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_translate (HomMat2DIdentity, -40, 0, HomMat2DTranslate)
affine_trans_contour_xld (BackWallBoundaryLineXLD, BackWallBoundaryLineXLDTranslated, HomMat2DTranslate)
Try using affine_trans_contour_xld(). You will have to setup a HomMat3D first that specifies your 40pixel translation.

Fit to frame with vertical justification options

Working with InDesign script I am using
TF.fit(FitOptions.frameToContent). //TF as a textFrame
to fit the content into the textframe and remove the extra space
But when I have a condition for vertical justification options set to Align: Bottom i am not able to fit the content.
Assuming this to be my TextFrame (Image 1)
Here are the properties of the text frame (Image 2)
When I do FitOptions.frameToContent i get this (Image 3)
But when the text frame has the align property set to the bottom I want this to fit it like this(this was achieved by double-clicking on the top center alignment as shown in the red indicator below. (Image 4) (Image 5)
I tried all the available options at http://jongware.mit.edu/idcs4js/pe_FitOptions.html but I had no luck making it work. Please help me to achieve the same using scripting.
Cross-reference: https://community.adobe.com/t5/indesign/fit-to-frame-with-vertical-justification-options/td-p/11120458?page=1
================== First try ==================
var tf = app.selection[0];
var tfp = tf.textFramePreferences;
tfp.autoSizingReferencePoint = AutoSizingReferenceEnum.BOTTOM_CENTER_POINT;
tfp.autoSizingType = AutoSizingTypeEnum.HEIGHT_ONLY;
tf.fit(FitOptions.frameToContent)
This still gives me the same result(image 3) but expected result is image 4.
================== Second try ==================
This is the auto-sizing property.
This command indeed seems to work only with the top edge as a reference point, just as it does in the UI (if you actually use the menu command, not clicking any borders).
What you could do to work around this, is to temporarily enable auto-sizing (height only) and setting the reference point for auto-sizing to the bottom:
var tf = app.selection[0];
var tfp = tf.textFramePreferences;
tfp.autoSizingReferencePoint = AutoSizingReferenceEnum.BOTTOM_CENTER_POINT;
tfp.autoSizingType = AutoSizingTypeEnum.HEIGHT_ONLY;
tfp.autoSizingType = AutoSizingTypeEnum.OFF;
Note, the last line turns off the auto sizing again and is optional; if you don't mind that the frame keeps auto sizing you don't need to turn it off.

Blender: How to export animation as GLTF file

I have made a very basic animation in Blender (2.79) and I am trying to export it as a GLTF or GLB. I have succesfully installed the gltf exporter and am able to export both gltfs and glbs of unanimated models no problem.
As soon as I add animation and try to export however, I get the following error message
The animation is as about as simple as it could be, I'm just experimenting. Its just the default box that changes location and rotation across 3/4 keyframes.
I am new to Blender so perhaps I am missing a step but my process is as follows: Add box to the scene, add keyframes (LocRot), go to export as I would with a static object, this has the following (default) settings.
I have tried clicking Pushdown on the action sheet as I have seen suggested somewhere but it makes no difference.
Am I missing something? Please let me know if you need any more info in order to advise, I'm happy to share the file or whatever might help.
NB this will eventually be used in a-frame so any specific tips on export for that would be much appreciated.
So after seeing someone else's export settings (thanks to the a-frame slack channel) I have got this working. I needed to have force sample animations selected in the animation export settings. Then it exports no problem and works as expected. Answering my own question in case anyone else has this problem.
Thanks.
To export multiple animated objects with armatures, vertex groups should have unique names. Here's a little script to rename bones and vertex groups based on parent armature name:
import bpy
for obj in bpy.context.selected_objects:
if obj.type == "ARMATURE":
prefix = obj.name + "_"
for bone in obj.data.bones:
bone.name = prefix + bone.name
if obj.type == "MESH":
prefix = obj.parent.name + "_"
for vg in obj.vertex_groups:
if vg.name[0:len(prefix)] != prefix:
vg.name = prefix + vg.name

GIMP Script-fu changing default scripts

I am having issues re-writing one of the default logo scripts in GIMP(using Script-fu based on scheme). For one thing the alpha layer is not shown in the layer browser after the image is shown. I am re-writing the Create Neon Logo script(neon-logo.scm) and I want it to do the following before it displays the new image:
add an alpha channel
change black(background color) to transparent via colortoalpha
return the generated image as an object to be used in another python script(using for loops to generate 49 images)
I have tried modifying the following code to the default script:
(gimp-image-undo-disable img)
(apply-neon-logo-effect img tube-layer size bg-color glow-color shadow) *Generates neon logo
(set! end-layer (car (gimp-image-flatten img))) *Flattens image
(gimp-layer-add-alpha end-layer) *Adds alpha layer as last layer in img(img=the image)
(plug-in-colortoalpha img 0 (255 255 255)) *Uses color to alpha-NOT WORKING
(gimp-image-undo-enable img) *Enables undo
(gimp-display-new img) *Displays new image
For number 3 my python code is this:
for str1 in list1:
for color1 in list3:
img = pdb.script_fu_neon_logo(str1,50,"Swis721 BdOul BT",(0,0,0),color1,0)
But img is a "Nonetype" object. I would like to make it so that instead of displaying the generated image in a new window, it just returns the generated image for use with my python script.
Can anyone help?
Maybe to keep everything more managaeable and readable, you should translate theoriginal script into Python - that way you willhaveno surprises on otherwiser trivial things as variable assignment, picking elements from sequences and so on.
1 and 2) your calls are apparantly correct to flaten an "add an alpha channel " (not "alpha layer",a s you write, please) to the image - but you are calling color-to-alpha to make White (255 255 255) transparemt not black. Trey changing that to (0 0 0) - if it does not work, make]
each of the calls individually, either on script-fu console or on python console, and check what is wrong.
3) Script-fu can't return values to the caller (as can be seen by not having a "return value type" parameter to the register call. That means that scripts in scheme in GIMP can only render thigns on themselves and not be used to compose more complex chains.
That leaves you with 2 options: port the original script to Python-fu (and them just register it to return a PF-IMAGE) - or hack around the call like this, in Python:
create a set with all images opened, call your script-fu, check which of your images currently open is not on the set of images previously opened - that will be your new image:
The tricky part with this is that: there is no unique identifier to an image when you see it from Python-fu - so you 'dhave to compose a value like (name, number_of_layers, size) to go on those comparison sets and even that might not suffice - or youg could juggle with "parasites" (arbitrary data that can be attached to an image). As you can see, having the original script-fu rewriten in Python, since all the work is done by PDB calls, and these translate 1:1, is preferable.

Compass - Get width and height of generated sprite-map

I'm building a Sencha Touch mobile application and are using the functionality to create image-sprite-maps with Compass.
Is there any way to calculate the size of the image-map (width and height) and put it as a variable in your SCSS file?
In Compass, image-height and image-width are the functions to get image dimensions. Using them with your sprite map would look something like this (warning, untested):
// Assuming $my-sprites is your sprite map variable
$map-path: sprite-path($my-sprites);
$map-height: image-height($map-path);
$map-width: image-width($map-path);
In the latest version of Sass (3.4) sprite-path() returns the full filesystem path while image-width() expects a path relative to the images directory. But there is a simple solution:
sprite-width($sprite-map);
sprite-height($sprite-map);
You can get a unit value by using the magical dimension functions <map>-sprite-height and <map>-sprite-width.
// Note: "my-icons" represents the folder name that contains your sprites.
#import "my-icons/*.png";
$box-padding: 5px;
$height: my-icons-sprite-height(some_icon);
$width: my-icons-sprite-width(some_icon);
.somediv {
height:$height + $box-padding;
width:$width + $box-padding;
}
Check the official documentation for more details.
Ext.getBody().getSize() gets you height and width of the screen but i dont think you can write this in SASS