<commit_before>package org.vovkasm.WebImage;

import com.facebook.react.uimanager.LayoutShadowNode;
import com.facebook.react.uimanager.Spacing;
import com.facebook.react.uimanager.UIViewOperationQueue;
import com.facebook.yoga.YogaConstants;

import java.util.Arrays;

class WebImageShadowNode extends LayoutShadowNode {
    private float[] mBorderWidths = new float[Spacing.ALL+1];

    WebImageShadowNode() {
        super();
        Arrays.fill(mBorderWidths, YogaConstants.UNDEFINED);
    }

    @Override
    public void setBorder(int spacingType, float borderWidth) {
        super.setBorder(spacingType, borderWidth);
        mBorderWidths[spacingType] = borderWidth;
    }

    private float getEffectiveBorderWidth(int spacing) {
        float width = mBorderWidths[spacing];
        if (YogaConstants.isUndefined(width)) width = mBorderWidths[Spacing.ALL];
        if (YogaConstants.isUndefined(width)) width = 0.0f;
        return width;
    }

    @Override
    public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
        super.onCollectExtraUpdates(uiViewOperationQueue);
        BoxMetrics bm = new BoxMetrics(
                getLayoutWidth(),
                getLayoutHeight(),
                getEffectiveBorderWidth(Spacing.LEFT),
                getEffectiveBorderWidth(Spacing.TOP),
                getEffectiveBorderWidth(Spacing.RIGHT),
                getEffectiveBorderWidth(Spacing.BOTTOM),
                getPadding(Spacing.LEFT),
                getPadding(Spacing.TOP),
                getPadding(Spacing.RIGHT),
                getPadding(Spacing.BOTTOM)
        );
        uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), bm);
    }

}<commit_msg>Fix border horizontal dimensions.<commit_after>package org.vovkasm.WebImage;

import com.facebook.react.uimanager.LayoutShadowNode;
import com.facebook.react.uimanager.Spacing;
import com.facebook.react.uimanager.UIViewOperationQueue;
import com.facebook.yoga.YogaConstants;

import java.util.Arrays;

class WebImageShadowNode extends LayoutShadowNode {
    private float[] mBorderWidths = new float[Spacing.ALL+1];

    WebImageShadowNode() {
        super();
        Arrays.fill(mBorderWidths, YogaConstants.UNDEFINED);
    }

    @Override
    public void setBorder(int spacingType, float borderWidth) {
        super.setBorder(spacingType, borderWidth);
        mBorderWidths[spacingType] = borderWidth;
    }

    private float getEffectiveBorderWidth(int spacing) {
        float width = mBorderWidths[spacing];
        if (YogaConstants.isUndefined(width)) width = mBorderWidths[Spacing.ALL];
        if (YogaConstants.isUndefined(width)) width = 0.0f;
        return width;
    }

    @Override
    public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
        super.onCollectExtraUpdates(uiViewOperationQueue);
        BoxMetrics bm = new BoxMetrics(
                getLayoutWidth(),
                getLayoutHeight(),
                getEffectiveBorderWidth(Spacing.START),
                getEffectiveBorderWidth(Spacing.TOP),
                getEffectiveBorderWidth(Spacing.END),
                getEffectiveBorderWidth(Spacing.BOTTOM),
                getPadding(Spacing.LEFT),
                getPadding(Spacing.TOP),
                getPadding(Spacing.RIGHT),
                getPadding(Spacing.BOTTOM)
        );
        uiViewOperationQueue.enqueueUpdateExtraData(getReactTag(), bm);
    }

}
{'fraction_non_alphanumeric': 0.0872210953346856, 'fraction_numerical': 0.0017386264850767893, 'mean_word_length': 2.936145952109464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5012165', 'n_tokens_mistral': 996, 'n_tokens_neox': 954, 'n_words': 153}