| 97 | } |
| 98 | |
| 99 | static void handleCrop(struct obs_sceneitem_crop &crop, const std::string &id, |
| 100 | const std::string &value) |
| 101 | { |
| 102 | int val = 0; |
| 103 | try { |
| 104 | val = std::stoi(value); |
| 105 | } catch (const std::invalid_argument &e) { |
| 106 | logConversionError(e, __func__, id.c_str(), value.c_str()); |
| 107 | return; |
| 108 | } catch (const std::out_of_range &e) { |
| 109 | logConversionError(e, __func__, id.c_str(), value.c_str()); |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | if (id == "left") { |
| 114 | crop.left = val; |
| 115 | } else if (id == "top") { |
| 116 | crop.top = val; |
| 117 | } else if (id == "right") { |
| 118 | crop.right = val; |
| 119 | } else if (id == "bottom") { |
| 120 | crop.bottom = val; |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | static void handlePosOrScaleOrBounds(struct obs_transform_info &info, |
| 125 | const TransformSetting &setting, |
no test coverage detected